Merge branch 'obsd-master'
[tmux.git] / regress / capture-pane-hyperlink.sh
blob681a8e17a6b2db45e38a6ba8285fa64af3ae4f67
1 #!/bin/sh
3 # capture-pane -e for OSC 8 hyperlink
5 PATH=/bin:/usr/bin
6 TERM=screen
8 [ -z "$TEST_TMUX" ] && TEST_TMUX=$(readlink -f ../tmux)
9 TMUX="$TEST_TMUX -Ltest"
10 TMP=$(mktemp)
11 TMP2=$(mktemp)
12 trap "rm -f $TMP $TMP2" 0 1 15
13 $TMUX kill-server 2>/dev/null
15 do_test() {
16 $TMUX -f/dev/null new -d "
17 printf '$1'
18 $TMUX capturep -peS0 -E1 >$TMP"
19 echo $2 > $TMP2
20 sleep 1
21 cmp $TMP $TMP2 || exit 1
22 return 0
25 do_test '\033]8;id=1;https://github.com\033\\test1\033]8;;\033\\\n' '\033]8;id=1;https://github.com\033\\test1\033]8;;\033\\\n' || exit 1
26 do_test '\033]8;;https://github.com/tmux/tmux\033\\test1\033]8;;\033\\\n' '\033]8;;https://github.com/tmux/tmux\033\\test1\033]8;;\033\\\n' || exit 1
28 $TMUX has 2>/dev/null && exit 1
30 exit 0