Merge branch 'obsd-master'
[tmux.git] / regress / kill-session-process-exit.sh
blob82cd7412671ae59505648bf07ed929fb120e1a44
1 #!/bin/sh
3 # when we kill a session, processes running in it should be killed
5 PATH=/bin:/usr/bin
6 TERM=screen
8 [ -z "$TEST_TMUX" ] && TEST_TMUX=$(readlink -f ../tmux)
9 TMUX="$TEST_TMUX -Ltest"
10 $TMUX kill-server 2>/dev/null
11 sleep 1
13 $TMUX -f/dev/null new -d 'sleep 1000' || exit 1
14 P=$($TMUX display -pt0:0.0 '#{pane_pid}')
15 $TMUX -f/dev/null new -d || exit 1
16 sleep 1
17 $TMUX kill-session -t0:
18 sleep 3
19 kill -0 $P 2>/dev/null && exit 1
20 $TMUX kill-server 2>/dev/null
22 exit 0