summaryrefslogtreecommitdiffstats
path: root/debian/tests/utmp
blob: e785679ed0bc231e172dae0f3be0c9ba836dcd09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/sh

# Check for regressions on https://github.com/tmux/tmux/issues/2022,
# where a utmp entry would not be created for new tmux sessions

set -e

SESSION="test_session"

if who | grep -q tmux; then
    echo >&2 "tmux should not have registered utmp entries yet"
    exit 1
fi

tmux new-session -d -s $SESSION

# make sure a utmp entry was created
if ! who | grep -q tmux; then
  # clean up
  tmux kill-session -t $SESSION
  echo >&2 "no utmp entries found for tmux"
  exit 1
fi

tmux kill-session -t $SESSION
if who | grep -q tmux; then
    echo >&2 "tmux should have unregistered utmp entries"
    exit 1
fi