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

Re: preexec and multi-line command.



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}}.



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