Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Misbehavior of "read" or ...?
- X-seq: zsh-workers 24409
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Misbehavior of "read" or ...?
- Date: Fri, 18 Jan 2008 09:38:59 -0800
- In-reply-to: <691a5d910801180119p32d48643wa55fd2aefaa3bf6a@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <20080104105900.37a87f7e@news01> <237967ef0801040304h494987bv939bf6ff9541123f@xxxxxxxxxxxxxx> <477E177A.3060303@xxxxxxxxxxxxx> <Xns9A20C0F173D23zzappergmailcom@xxxxxxxxxxxx> <080113000048.ZM15017@xxxxxxxxxxxxxxxxxxxxxx> <20080116131048.GC16058@xxxxxxxxx> <080116075915.ZM12209@xxxxxxxxxxxxxxxxxxxxxx> <20080116171253.GF16058@xxxxxxxxx> <080116191103.ZM12889@xxxxxxxxxxxxxxxxxxxxxx> <20080117172603.GA664@xxxxxxxxx> <691a5d910801180119p32d48643wa55fd2aefaa3bf6a@xxxxxxxxxxxxxx>
On Jan 18, 1:19am, Bart Schaefer wrote to zsh-users:
}
} function xterm-ask {
} local esc
} unset REPLY reply
} 1=get_${1#get_}
} xterm-tell $1
} case $1 in
} (get_(label|title))
} read -t 2 -rk 3 esc || return 1
} read -rsd $'\e'
} read -rk 1 esc
} ;;
} (get_*)
} read -t 2 -rk 2 esc || return 1
} IFS=';' read -Arsd t
} (( $#reply > 2 )) && shift reply
} ;;
} esac
} return 0
} }
The above works flawlessly in 4.2.6, but in 4.3.4-dev-7 I can't seem to
stop it from echoing the terminal's response in a way that the user can
see it. Even wrapping the whole thing in "stty -echo" doesn't help.
If I run
xterm-tell get_position; IFS=';' read -Arsd t
from the command line, it works as expected. It's only when running
it in a shell function that it misbehaves. I've tried changing from
"-rk" to "-rsk" in each place it's used; doesn't seem to matter.
I've also redirected the output of "case ... esac" to /dev/null with
no better result. The response IS getting seen by "read":
schaefer<524> xterm-ask get_position
^[[3;1016;546t%
schaefer<525> print $reply
1016 546
schaefer<526> unset reply
schaefer<527> xterm-tell get_position; IFS=';' read -Arsd t
schaefer<528> print $reply
1016 546
If I "set -x" the output appears immediately after the trace prints that
"read" is going to be executed, so *something* that "read" is doing is
causing the output to be echoed, I think:
: xterm-ask:5:case; case get_iconify (get_*)
: xterm-ask:9:case; read -t 2 -rsk 2 esc
^[[1t^[[1t: xterm-ask:10:case; IFS=';' : xterm-ask:10:case; read -Arsd t
: xterm-ask:11:case; (( 1 > 2 ))
: xterm-ask:13; return 0
I've tried removing the -t 2, skipping the "read -rk", etc. No change.
This is really annoying.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author