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

Re: preexec and multi-line command.



On Sat, Feb 20, 2010 at 9:55 PM, Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Feb 20, Â8:20pm, Piotr Karbowski wrote:
> }
> } Â Â Â Â preexec () { print -Pn "\e]0;$1 [%n@%m: %~]\a"}
>
> We had someone else just a couple of weeks ago posting about a similar
> problem.
>
> The issue is that when you expand $1 in that sequence, which is I
> believe intended to set the terminal title, the string to which $1
> expands may include characters (in this case probably newlines)
> that interrupt the terminal's processing of the title-bar sequence.
>
> This leaves the terminal in a state where it is still capturing the
> subsequent output and interpreting it as control instructions, so
> that output disappears.
>
> Try replacing $1 with ${(fV)1} to avoid this. ÂYou might even want to
> truncate the string placed in the title bar, e.g. ${(r:20:)${(fV)1}}.

Thanks, ${(fV)1} is solution.



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