From abad809e7a9d90945df1a31433109181e04c9242 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Fri, 28 Apr 2017 20:22:01 +0100 Subject: [PATCH] Test that kill-session closes the panes (processes end up dead). --- regress/kill-session-process-exit.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 regress/kill-session-process-exit.sh diff --git a/regress/kill-session-process-exit.sh b/regress/kill-session-process-exit.sh new file mode 100644 index 00000000..27d883e2 --- /dev/null +++ b/regress/kill-session-process-exit.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +# when we kill a session, processes running in it should be killed + +PATH=/bin:/usr/bin +TERM=screen + +[ -z "$TEST_TMUX" ] && TEST_TMUX=$(readlink -f ../tmux) +TMUX="$TEST_TMUX -Ltest" +$TMUX kill-server 2>/dev/null + +$TMUX new -d 'sleep 1000' || exit 1 +P=$($TMUX display -pt0:0.0 '#{pane_pid}') +$TMUX new -d || exit 1 +sleep 1 +$TMUX kill-session -t0: +sleep 1 +kill -0 $P 2>/dev/null && exit 1 +$TMUX kill-server 2>/dev/null + +exit 0