From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh list <zsh-workers@sunsite.dk>
Subject: Re: problem with push-line-or-edit and precmd?
Date: Fri, 16 Jan 2009 20:08:52 -0800 [thread overview]
Message-ID: <090116200852.ZM22480@torch.brasslantern.com> (raw)
In-Reply-To: <18801.2149.303884.532633@gargle.gargle.HOWL>
On Jan 16, 5:21pm, Greg Klanderman wrote:
}
} Notice the precmd is run when the push-line-or-edit widget is invoked,
} and that $? is set to 1 in the precmd.
}
} Is it expected that precmd would be run here?
}
} And if so, why is a non-zero exit status set?
This is an admitted misfeature of the push-line-or-edit implementation,
which in order to accomplish its purpose of invoking the editor on the
multi-line buffer as a single editable region, does almost exactly the
equivalent of
print -z "$BUFFER"
zle send-break
This causes the current zle "session" to abort, which returns from the
PS2 or deeper prompt all the way to the top level, at which point the
editor re-initializes at the PS1 prompt and pops the buffer stack and
you're back where you want to be.
The side-effects of this include that a zle widget can't do anything
after push-line-or-edit (the widget forcibly exits), the status is
set to nonzero, and precmd runs because the editor has restarted, all
as if the user hit ctrl+c.
This is one case where a change would be welcome, if a better way could
be found to trash the entire nested editor context up from whatever
prompt level you're reached, and thereby reset at PS1.
next prev parent reply other threads:[~2009-01-17 4:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-16 22:21 Greg Klanderman
2009-01-17 4:08 ` Bart Schaefer [this message]
2009-01-17 6:39 ` Greg Klanderman
2009-01-17 19:06 ` Bart Schaefer
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=090116200852.ZM22480@torch.brasslantern.com \
--to=schaefer@brasslantern.com \
--cc=zsh-workers@sunsite.dk \
/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).