Skip to content

Commit

Permalink
Add hyperlink test, from Jeff Chiang.
Browse files Browse the repository at this point in the history
  • Loading branch information
nicm committed Jul 6, 2022
1 parent 57fec74 commit 8e8b986
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
30 changes: 30 additions & 0 deletions regress/capture-pane-hyperlink.sh
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions regress/capture-pane-sgr0.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8e8b986

Please sign in to comment.