zsh-workers
 help / color / mirror / code / Atom feed
From: Frank Terbeck <ft@bewatermyfriend.org>
To: zsh-workers@zsh.org
Subject: PATCH: edit-command-line: disable `monitor' option locally
Date: Wed, 16 Mar 2011 21:16:10 +0100	[thread overview]
Message-ID: <1300306570-24592-1-git-send-email-ft@bewatermyfriend.org> (raw)

I was just told, that suspending an editor while using
`edit-command-line' will cause the command line to be lost, yielding
this:

edit-command-line:zle:17: widgets can only be called when ZLE is active

Which makes sense.

I first thought to disable suspending by disabling the appropriate
shortcut via `stty'. But that doesn't work if the editor suspends anyway
when it sees a "C-z" byte (vim does).

So, in order to shield users from accidential dataloss, this patch
unsets the `monitor' option temporarily. That does the trick for me and
I don't think there is anything this would break.

If I'm missing something, yell.
---
 Functions/Zle/edit-command-line |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/Functions/Zle/edit-command-line b/Functions/Zle/edit-command-line
index 250cac6..efcc4b9 100644
--- a/Functions/Zle/edit-command-line
+++ b/Functions/Zle/edit-command-line
@@ -6,6 +6,8 @@
 # will give ksh-like behaviour for that key,
 # except that it will handle multi-line buffers properly.
 
+setopt local_options no_monitor
+
 local tmpfile=${TMPPREFIX:-/tmp/zsh}ecl$$
 
 print -R - "$PREBUFFER$BUFFER" >$tmpfile
-- 
1.7.4.1.140.g89781


             reply	other threads:[~2011-03-16 20:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-16 20:16 Frank Terbeck [this message]
2011-03-17  4:04 ` Bart Schaefer
2011-03-17 10:08   ` Frank Terbeck
2011-03-17 15:25     ` Bart Schaefer
2011-03-17 17:56       ` Frank Terbeck
2011-03-18  1:11         ` Bart Schaefer
2011-04-25 14:55           ` Frank Terbeck
2011-04-25 16:21             ` Bart Schaefer
2011-04-25 22:25               ` Frank Terbeck

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=1300306570-24592-1-git-send-email-ft@bewatermyfriend.org \
    --to=ft@bewatermyfriend.org \
    --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).