zsh-workers
 help / color / mirror / code / Atom feed
* Re: edit-command-line, vim, and pasting
       [not found]   ` <18028.1446462993@thecus.kiddle.eu>
@ 2015-11-03 17:31     ` Bart Schaefer
  2015-11-05 11:09       ` Oliver Kiddle
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Schaefer @ 2015-11-03 17:31 UTC (permalink / raw)
  To: zsh-workers

[> workers]

On Nov 2, 12:16pm, Oliver Kiddle wrote:
}
} Bart wrote:
} > We need a generalized fix for this.  Oliver?
} 
} I'm not sure we can do anything more generalized than the following
} patch to edit-command-line. Perhaps the zle builtin could have an option
} to cover the situation but that doesn't help much because the function
} would still need to invoke the builtin. What did you have in mind?

Mostly I was dumping it in your lap because you introduced this feature.

Ideally there'd be some mechanism ala the STTY parameter / ttyctl that
resets this state every time an external command gets control of the
terminal.


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

* Re: edit-command-line, vim, and pasting
  2015-11-03 17:31     ` edit-command-line, vim, and pasting Bart Schaefer
@ 2015-11-05 11:09       ` Oliver Kiddle
  2015-11-05 17:22         ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Oliver Kiddle @ 2015-11-05 11:09 UTC (permalink / raw)
  Cc: zsh-workers

Bart wrote:
> Ideally there'd be some mechanism ala the STTY parameter / ttyctl that
> resets this state every time an external command gets control of the
> terminal.

It needs to send both an end sequence before the external command
gets control and a start sequence once that external command has
finished. I don't think it'd be great to spew out the sequences every
time an external command is run. That could add up to quite a few escape
sequences being generated for completion - and to no real purpose.
I'm not aware of any signals or other mechanisms to detect commands
reading from the terminal after they've been executed and even if there
was, it wouldn't actually help for many reasons.

edit-command-line already does this:
  exec </dev/tty
I'm not quite sure why stdin (but not stdout/stderr) is closed for zle
widgets but we could generate sequences only for commands executed with
the tty opened on fd 0. However, it is easier to just handle the case
specifically in edit-command-line.

Oliver


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

* Re: edit-command-line, vim, and pasting
  2015-11-05 11:09       ` Oliver Kiddle
@ 2015-11-05 17:22         ` Bart Schaefer
  0 siblings, 0 replies; 3+ messages in thread
From: Bart Schaefer @ 2015-11-05 17:22 UTC (permalink / raw)
  To: zsh-workers

On Nov 5, 12:09pm, Oliver Kiddle wrote:
}
} I'm not quite sure why stdin (but not stdout/stderr) is closed for zle
} widgets but we could generate sequences only for commands executed with
} the tty opened on fd 0. However, it is easier to just handle the case
} specifically in edit-command-line.

OK.  Somewhere (perhaps both in description of the zle_bracketed_paste
variable and in the section on user-defined widgets?) the doc should
note the need to do this end/start thing when running an external
command.

Or maybe as you mentioned there should be a built-in way to do it
safely -- "zle -X command [args]" which does the "exec < /dev/tty"
and wraps the command in the bracketed-paste sequences and possibly
also does an implicit "zle -I"?


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

end of thread, other threads:[~2015-11-05 17:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CAPZ477Oz5BCB797hpE5SO+X9f_Sz8BXX49nUZ9jPERgVGcXHzw@mail.gmail.com>
     [not found] ` <151101103921.ZM16163@torch.brasslantern.com>
     [not found]   ` <18028.1446462993@thecus.kiddle.eu>
2015-11-03 17:31     ` edit-command-line, vim, and pasting Bart Schaefer
2015-11-05 11:09       ` Oliver Kiddle
2015-11-05 17:22         ` Bart Schaefer

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