Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: print to the terminal in zle



On Fri, 26 Jul 2013 14:48:11 +0100
Stephane Chazelas <stephane.chazelas@xxxxxxxxx> wrote:
> recently, Debian broke some of my scripts using ZLE in `zsh -i` by adding:
> 
>         function zle-line-init () {
>             emulate -L zsh
>             printf '%s' ${terminfo[smkx]}
>         }
> 
> To /etc/zsh/zshrc
> 
> That smkx  escape sequence is printed to stdout instead of the terminal.

It's just occurred to me that maybe zle special functions should be run
with stdout and stdin set explicitly to the terminal.  Arguably they
have no business knowing about a redirected stdout or stdin since they
run in a context where that's meaningless.  stderr would be good enough
for debugging.

-- 
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/



Messages sorted by: Reverse Date, Date, Thread, Author