diff options
author | Bart Schaefer <barts@users.sourceforge.net> | 2008-02-18 03:30:22 +0000 |
---|---|---|
committer | Bart Schaefer <barts@users.sourceforge.net> | 2008-02-18 03:30:22 +0000 |
commit | 00e6c6e0f5bd48d730d77e76379cfd0b17325a70 (patch) | |
tree | 48faefaffd9a9d53ae55834699d6b1048cc91b29 /Functions/Misc | |
parent | f27887653831a3014473e188a8ae54956b6bbf91 (diff) | |
download | zsh-00e6c6e0f5bd48d730d77e76379cfd0b17325a70.tar.gz zsh-00e6c6e0f5bd48d730d77e76379cfd0b17325a70.tar.xz zsh-00e6c6e0f5bd48d730d77e76379cfd0b17325a70.zip |
unposted: Functions/Misc/xtermctl: update uses of "read" to take advantage
of users/12600.
Diffstat (limited to 'Functions/Misc')
-rw-r--r-- | Functions/Misc/xtermctl | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/Functions/Misc/xtermctl b/Functions/Misc/xtermctl index 04fcf3637..c771fc39a 100644 --- a/Functions/Misc/xtermctl +++ b/Functions/Misc/xtermctl @@ -44,19 +44,23 @@ function xterm-tell { print -nr -- $'\e['"${seq}"t } +# The following use of "read -st 2 ..." with the control sequences in +# the prompt string requires zsh 4.3.5-dev-1 or later (zsh-users/12600 +# or equivalent patch). + function xterm-ask { local esc unset REPLY reply 1=get_${1#get_} - xterm-tell $1 + local seq=${xtermseq[$1]:?no such control} case $1 in (get_(label|title)) - read -t 2 -rk 3 esc || return 1 - read -rsd $'\e' - read -rk 1 esc + read -st 2 -rk 3 esc$'?\e['"${seq}"t || return 1 + read -srd $'\e' + read -srk 1 esc ;; (get_*) - read -t 2 -rk 2 esc || return 1 + read -st 2 -rk 2 esc$'?\e['"${seq}"t || return 1 IFS=';' read -Arsd t (( $#reply > 2 )) && shift reply ;; |