zsh-workers
 help / color / mirror / code / Atom feed
From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: This is probably known and wont-fix: zpty -w always adds a new line
Date: Wed, 7 Nov 2018 12:31:15 +0100	[thread overview]
Message-ID: <CAKc7PVD9DiFRhTb1m5fTXeeW1RROYPpTmxKnCUfL-1FY7s_gKQ@mail.gmail.com> (raw)

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

             reply	other threads:[~2018-11-07 11:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20181107113210epcas3p4cf89233ec2bbb8a604435389f5123845@epcas3p4.samsung.com>
2018-11-07 11:31 ` Sebastian Gniazdowski [this message]
2018-11-07 12:01   ` Peter Stephenson
2018-11-07 12:21     ` Sebastian Gniazdowski
2018-11-07 12:30     ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKc7PVD9DiFRhTb1m5fTXeeW1RROYPpTmxKnCUfL-1FY7s_gKQ@mail.gmail.com \
    --to=sgniazdowski@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).