Add hyperlink test, from Jeff Chiang.

This commit is contained in:
Nicholas Marriott 2022-07-06 09:02:12 +01:00
parent 57fec74966
commit 8e8b9865d1
2 changed files with 32 additions and 2 deletions

View File

@ -0,0 +1,30 @@
#!/bin/sh
# capture-pane -e for OSC 8 hyperlink
PATH=/bin:/usr/bin
TERM=screen
[ -z "$TEST_TMUX" ] && TEST_TMUX=$(readlink -f ../tmux)
TMUX="$TEST_TMUX -Ltest"
TMP=$(mktemp)
TMP2=$(mktemp)
trap "rm -f $TMP $TMP2" 0 1 15
$TMUX kill-server 2>/dev/null
do_test() {
$TMUX -f/dev/null new -d "
printf '$1'
$TMUX capturep -peS0 -E1 >$TMP"
echo $2 > $TMP2
sleep 1
cmp $TMP $TMP2 || exit 1
return 0
}
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
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
$TMUX has 2>/dev/null && exit 1
exit 0

View File

@ -22,8 +22,8 @@ $TMUX -f/dev/null new -d "
sleep 1
(
printf '\033[1m\033[31m\033[42mabc\033[0m\033[31m\033[49mdef\033[39m\n'
printf '\033[100m bright bg \033[49m\n'
printf '\033[1m\033[31m\033[42mabc\033[0m\033[31m\033[49mdef\n'
printf '\033[39m\033[100m bright bg\n'
) | cmp - $TMP || exit 1
$TMUX has 2>/dev/null && exit 1