diff options
Diffstat (limited to 'app/xterm/vttests/title.sh')
-rw-r--r-- | app/xterm/vttests/title.sh | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/app/xterm/vttests/title.sh b/app/xterm/vttests/title.sh index 7b7f4d6d7..62f2753b6 100644 --- a/app/xterm/vttests/title.sh +++ b/app/xterm/vttests/title.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $XTermId: title.sh,v 1.23 2022/02/13 14:36:47 tom Exp $ +# $XTermId: title.sh,v 1.26 2022/04/25 08:19:38 tom Exp $ # ----------------------------------------------------------------------------- # this file is part of xterm # @@ -39,14 +39,15 @@ CSI="${ESC}[" CMD='/bin/echo' OPT='-n' SUF='' -TMP=`(mktemp) 2>/dev/null` || TMP=/tmp/xterm$$ +: "${TMPDIR=/tmp}" +TMP=`(mktemp "$TMPDIR/xterm.XXXXXXXX") 2>/dev/null` || TMP="$TMPDIR/xterm$$" eval '$CMD $OPT >$TMP || echo fail >$TMP' 2>/dev/null -{ test ! -f $TMP || test -s $TMP; } && +{ test ! -f "$TMP" || test -s "$TMP"; } && for verb in "printf" "print" ; do - rm -f $TMP + rm -f "$TMP" eval '$verb "\c" >$TMP || echo fail >$TMP' 2>/dev/null - if test -f $TMP ; then - if test ! -s $TMP ; then + if test -f "$TMP" ; then + if test ! -s "$TMP" ; then CMD="$verb" OPT= SUF='\c' @@ -54,14 +55,14 @@ for verb in "printf" "print" ; do fi fi done -rm -f $TMP +rm -f "$TMP" exec </dev/tty old=`stty -g` stty raw -echo min 0 time 5 $CMD $OPT "${CSI}21t${SUF}" > /dev/tty -read original +read -r original stty $old |