about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBart Schaefer <barts@users.sourceforge.net>2008-02-18 03:30:22 +0000
committerBart Schaefer <barts@users.sourceforge.net>2008-02-18 03:30:22 +0000
commit00e6c6e0f5bd48d730d77e76379cfd0b17325a70 (patch)
tree48faefaffd9a9d53ae55834699d6b1048cc91b29
parentf27887653831a3014473e188a8ae54956b6bbf91 (diff)
downloadzsh-00e6c6e0f5bd48d730d77e76379cfd0b17325a70.tar.gz
zsh-00e6c6e0f5bd48d730d77e76379cfd0b17325a70.tar.xz
zsh-00e6c6e0f5bd48d730d77e76379cfd0b17325a70.zip
unposted: Functions/Misc/xtermctl: update uses of "read" to take advantage
of users/12600.
-rw-r--r--ChangeLog3
-rw-r--r--Functions/Misc/xtermctl14
2 files changed, 12 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index e69bf5ccd..9d7134884 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,9 @@
 	so that terminal input modes are set before attempting a
 	read-poll.  Also display any prompt before read-polling.
 
+	* unposted: Functions/Misc/xtermctl: update uses of "read" to
+	take advantage of users/12600.
+
 2008-02-17  Peter Stephenson  <p.w.stephenson@ntlworld.com>
 
 	* 24566: Doc/Zsh/prompt.yo, Src/prompt.c: fallout:
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
       ;;