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

This is probably known and wont-fix: zpty -w always adds a new line



Hello,
according to man, zpty -w should add a new-line only if invoked with
option -n. But the experience, e.g. the written command-line (to
Src/zsh zpty process) always gets executed, even without -n – says a
new-line is written also without -n.

Also other proof, I have a function zpty_input (a modified
W02jobs.ztst function) that if obtains string "nl" as $2, then it
emits $'\n' after the input ($1; to in-zpty ran Src/zsh). Now,
assuming zpty doesn't write new line without -n, I was using `nl'
string after each command (not after \C-a key). The effect: number of
Zle-echoed-back lines (again, the zpty process is Src/zsh with Zle
active) was doubled, i.e. I was receiving my sent commands (correct,
$'\n'-ended) and the same number of empty lines.

Conclusion: my `nl' / $'\n' new-line was followed by zpty -w new-line
and this resulted in an empty line after each zpty -w. Removing my
`nl' allows to read normal, not doubled number of echoed-back lines,
which results in a less-hacky or tricky impression when reading the
code.

I guess this is a wont-fix and maybe even something known. Projects
zsh-async and zsh-autosuggestions are using `zpty'  and changing the
current behavior would cause problems for them. That said, it's now
impossible to e.g. just enter a text at zpty/zsh command-line and do
nothing.

-- 
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org



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