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
- X-seq: zsh-workers 43785
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: This is probably known and wont-fix: zpty -w always adds a new line
- Date: Wed, 7 Nov 2018 12:31:15 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=brW48kIt8gtCBS6fx61BXmjpgZJ/vYqyHwmjTnCwrZY=; b=aqbwsCh1szl7ggZNkSg01StKTJPYcrWFvMim71BCuwBQSk6zvuCsdubCnxXtWHlILA k7hy2RQP9GEl8r5cwRSIgU9i5D7BJDqMx5n9d29dZglk+hH+sJgRoeV03g9Ou/W0Eg1k vbul2A0F4eHzL0f+spIoEXui/dvEbBGW8oMUx9i7AUzwKXNEcs5mMNbeKTc4zMv/Mzv+ oI1AmTs0bRoRg2nzI4Oov4GALMm5yAvo3FKtBqcg6AyNYRjNYdLHoJIE1w1P+kf9tRUM 0gkA+oGhJ8sLU5acq5RXsdu+c5R2+8uzqVl0jHyCbGfjsFCN8G73NSCnOolWCcsXSW7j lMvA==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
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