zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: edit-command-line: disable `monitor' option locally
@ 2011-03-16 20:16 Frank Terbeck
  2011-03-17  4:04 ` Bart Schaefer
  0 siblings, 1 reply; 9+ messages in thread
From: Frank Terbeck @ 2011-03-16 20:16 UTC (permalink / raw)
  To: zsh-workers

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


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-04-25 22:38 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-16 20:16 PATCH: edit-command-line: disable `monitor' option locally Frank Terbeck
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

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).