zsh-workers
 help / color / mirror / code / Atom feed
From: Frank Terbeck <ft@bewatermyfriend.org>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: zsh-workers@zsh.org
Subject: Re: PATCH: edit-command-line: disable `monitor' option locally
Date: Thu, 17 Mar 2011 18:56:02 +0100	[thread overview]
Message-ID: <87pqppiqbx.fsf@ft.bewatermyfriend.org> (raw)
In-Reply-To: <110317082534.ZM26573@torch.brasslantern.com> (Bart Schaefer's message of "Thu, 17 Mar 2011 08:25:34 -0700")

Bart Schaefer wrote:
> On Mar 17, 11:08am, Frank Terbeck wrote:
[...]
> } Um. How do you end up with a backgrounded editor with this patch?
> } Shouldn't it be impossible to background the editor if `monitor' is
> } unset? I can't seem to get that to happen on my linux-based laptop.
[...]
> Now here's how it differs with your patch applied:
>
> torch% echo otherthing
>
> torch% echo otherthing
> otherthing
> torch% jobs
> [1]  + suspended  
> torch% 
>
> I.e. the only thing that changed was whether I got notified about the
> job being suspended.  Vim still handled the ^Z and stopped itself.
> But bad things happen if I try to bring it back into the foreground
> because zsh doesn't send CONT to the correct process group (I think
> is what's going on, but I can't be sure).

Huh. That's quite bad. :-/

> } In any case, I think the widget should protect the user from losing the
> } command line. And disallowing the editor from backgrounding should do
> } that (and in fact does for me).
>
> I agree but don't think twaddling no_monitor is sufficient.  If you
> remove no_monitor but add xtrace to the setopts in edit-command-line,
> what do you see after you hit ^Z in vim?  I get this:
>
> ----
> torch% echo foo+edit-command-line:2> local 'tmpfile=/tmp/zshecl26567'
> +edit-command-line:3> print -R - 'echo foo'
> +edit-command-line:5> vi /tmp/zshecl26567
>
>
> zsh: suspended  
> torch% echo foo+edit-command-line:6> print -Rz - 'echo foo'
> +edit-command-line:7> rm -f /tmp/zshecl26567
> +edit-command-line:8> zle send-break
>
> torch% echo foo
> ----
>
> I suspect that in your case the entire edit-command-line function is
> stopped, so rm -f / zle send-break never happens until after you bring
> it into the foreground again, but I don't know why it differs for me.

Here it is:
[snip]
% zsh -f
zsh% cat t
autoload -Uz edit-command-line
zle -N edit-command-line
bindkey $'\ee' edit-command-line
zsh% source ./t
zsh% echo foobar+edit-command-line:11> local 'tmpfile=/tmp/zshecl16683'
+edit-command-line:13> print -R - 'echo foobar'
+edit-command-line:15> vim /tmp/zshecl16683
zsh: suspended  

zsh% fg
[1]  + continued  
+edit-command-line:16> print -Rz - 'echo foobar'
+edit-command-line:18> rm -f /tmp/zshecl16683
+edit-command-line:19> zle send-break
edit-command-line:zle:19: widgets can only be called when ZLE is active
[snap]


-- 
In protocol design, perfection has been reached not when there is
nothing left to add, but when there is nothing left to take away.
                                                  -- RFC 1925


  reply	other threads:[~2011-03-17 17:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-16 20:16 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 [this message]
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=87pqppiqbx.fsf@ft.bewatermyfriend.org \
    --to=ft@bewatermyfriend.org \
    --cc=schaefer@brasslantern.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).