zsh-users
 help / color / mirror / code / Atom feed
* Pasting a line end doesn't work anymore
@ 2015-06-30  9:32 Helmut Jarausch
  2015-06-30 10:10 ` Peter Stephenson
  2015-06-30 16:39 ` Mikael Magnusson
  0 siblings, 2 replies; 10+ messages in thread
From: Helmut Jarausch @ 2015-06-30  9:32 UTC (permalink / raw)
  To: Zsh Users' List

Hi,

after the last upgrade (GIT 27.06.2015) the following doesn't work anymore.

If I paste some lines (including end-of-line) into an xterm the commands aren't executed unless
I enter <ENTER> on my keyboard in addition.

Is this an intended change? I didn't change my installed xterm for quite a while.

Many thanks for a hint,
Helmut



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

* Re: Pasting a line end doesn't work anymore
  2015-06-30  9:32 Pasting a line end doesn't work anymore Helmut Jarausch
@ 2015-06-30 10:10 ` Peter Stephenson
  2015-06-30 15:03   ` Ray Andrews
  2015-06-30 16:39 ` Mikael Magnusson
  1 sibling, 1 reply; 10+ messages in thread
From: Peter Stephenson @ 2015-06-30 10:10 UTC (permalink / raw)
  To: Zsh Users' List

On Tue, 30 Jun 2015 11:32:18 +0200
Helmut Jarausch <jarausch@igpm.rwth-aachen.de> wrote:
> after the last upgrade (GIT 27.06.2015) the following doesn't work anymore.
> 
> If I paste some lines (including end-of-line) into an xterm the commands aren't executed unless
> I enter <ENTER> on my keyboard in addition.
> 

It is --- pasted text is treated just as text, not editor commands.

However, I was thinking it needed something in README to explain what's
going on and point at the controls.

pws


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

* Re: Pasting a line end doesn't work anymore
  2015-06-30 10:10 ` Peter Stephenson
@ 2015-06-30 15:03   ` Ray Andrews
  2015-06-30 15:42     ` Peter Stephenson
  0 siblings, 1 reply; 10+ messages in thread
From: Ray Andrews @ 2015-06-30 15:03 UTC (permalink / raw)
  To: zsh-users

On 06/30/2015 03:10 AM, Peter Stephenson wrote:
> On Tue, 30 Jun 2015 11:32:18 +0200
> Helmut Jarausch <jarausch@igpm.rwth-aachen.de> wrote:
>> after the last upgrade (GIT 27.06.2015) the following doesn't work anymore.
>>
>> If I paste some lines (including end-of-line) into an xterm the commands aren't executed unless
>> I enter <ENTER> on my keyboard in addition.
I've long since given up being astonished at how some things work, but 
am I to take from this that there is/was a time when you'd paste a line 
of text (with the end of line there by virtue of it being a line of 
text) into an xterm and it would execute?  And this would be considered 
proper?

>>
> It is --- pasted text is treated just as text, not editor commands.
>
> However, I was thinking it needed something in README to explain what's
> going on and point at the controls.
>
> pws
>


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

* Re: Pasting a line end doesn't work anymore
  2015-06-30 15:03   ` Ray Andrews
@ 2015-06-30 15:42     ` Peter Stephenson
  2015-06-30 15:48       ` Bart Schaefer
  2015-06-30 16:05       ` Ray Andrews
  0 siblings, 2 replies; 10+ messages in thread
From: Peter Stephenson @ 2015-06-30 15:42 UTC (permalink / raw)
  To: zsh-users

On Tue, 30 Jun 2015 08:03:32 -0700
Ray Andrews <rayandrews@eastlink.ca> wrote:
> I've long since given up being astonished at how some things work, but 
> am I to take from this that there is/was a time when you'd paste a line 
> of text (with the end of line there by virtue of it being a line of 
> text) into an xterm and it would execute?  And this would be considered 
> proper?

Yes, until just recently, it would execute arbitrary stuff, quite
possibly including key strokes you couldn't even see.  Like you,
and it would appear most of us round here, that's never seemed
a particularly good idea to me.

Traditionally, cut-and-paste is handled identically to keyboard input.
You need to jump through a hoop, which luckily is nowadays quite common,
to make it not do that.

Hence the change...

pws


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

* Re: Pasting a line end doesn't work anymore
  2015-06-30 15:42     ` Peter Stephenson
@ 2015-06-30 15:48       ` Bart Schaefer
  2015-06-30 16:20         ` Ray Andrews
  2015-06-30 16:05       ` Ray Andrews
  1 sibling, 1 reply; 10+ messages in thread
From: Bart Schaefer @ 2015-06-30 15:48 UTC (permalink / raw)
  To: Zsh Users

On Tue, Jun 30, 2015 at 8:42 AM, Peter Stephenson
<p.stephenson@samsung.com> wrote:
>
> Traditionally, cut-and-paste is handled identically to keyboard input.

Note this isn't a shell thing, it's a terminal emulator thing.  Until
not very long ago there was no way for the program running inside the
terminal emulator to tell the difference, except by e.g. guessing that
nobody could possibly be typing as fast as the pasted input was
arriving.


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

* Re: Pasting a line end doesn't work anymore
  2015-06-30 15:42     ` Peter Stephenson
  2015-06-30 15:48       ` Bart Schaefer
@ 2015-06-30 16:05       ` Ray Andrews
  1 sibling, 0 replies; 10+ messages in thread
From: Ray Andrews @ 2015-06-30 16:05 UTC (permalink / raw)
  To: zsh-users

On 06/30/2015 08:42 AM, Peter Stephenson wrote:
> On Tue, 30 Jun 2015 08:03:32 -0700
> Ray Andrews <rayandrews@eastlink.ca> wrote:
>> I've long since given up being astonished at how some things work, but
>> am I to take from this that there is/was a time when you'd paste a line
>> of text (with the end of line there by virtue of it being a line of
>> text) into an xterm and it would execute?  And this would be considered
>> proper?
> Yes, until just recently, it would execute arbitrary stuff, quite
> possibly including key strokes you couldn't even see.  Like you,
> and it would appear most of us round here, that's never seemed
> a particularly good idea to me.
>
> Traditionally, cut-and-paste is handled identically to keyboard input.
> You need to jump through a hoop, which luckily is nowadays quite common,
> to make it not do that.
>
> Hence the change...
Well then thanks!  You can imagine how I would have foamed at the mouth 
had I experienced that firsthand  ;-)

And, had I foamed, I'd have expected the usual reply that it's been like 
that for decades and can't change because it wouldn't be compatible with 
csh ... so, I'm most pleased to see the readiness to fix something 
that's dumb, tradition or not :-)

Excellento

>
> pws
>


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

* Re: Pasting a line end doesn't work anymore
  2015-06-30 15:48       ` Bart Schaefer
@ 2015-06-30 16:20         ` Ray Andrews
  2015-06-30 17:35           ` Bart Schaefer
  0 siblings, 1 reply; 10+ messages in thread
From: Ray Andrews @ 2015-06-30 16:20 UTC (permalink / raw)
  To: zsh-users

On 06/30/2015 08:48 AM, Bart Schaefer wrote:
> On Tue, Jun 30, 2015 at 8:42 AM, Peter Stephenson
> <p.stephenson@samsung.com> wrote:
>> Traditionally, cut-and-paste is handled identically to keyboard input.
> Note this isn't a shell thing, it's a terminal emulator thing.  Until
> not very long ago there was no way for the program running inside the
> terminal emulator to tell the difference, except by e.g. guessing that
> nobody could possibly be typing as fast as the pasted input was
> arriving.
>
I see. so zsh running in an xterm just sits there with it's mouth open 
eating characters as normal, and if it's force-fed via a cut and paste 
there's no obvious way for it to know the difference. So how was that 
changed?  Somehow the shell would have to be notified that it's a cut 
and paste, no?  And that would have to come from the emulator naturally.


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

* Re: Pasting a line end doesn't work anymore
  2015-06-30  9:32 Pasting a line end doesn't work anymore Helmut Jarausch
  2015-06-30 10:10 ` Peter Stephenson
@ 2015-06-30 16:39 ` Mikael Magnusson
  1 sibling, 0 replies; 10+ messages in thread
From: Mikael Magnusson @ 2015-06-30 16:39 UTC (permalink / raw)
  To: jarausch; +Cc: Zsh Users' List

On Tue, Jun 30, 2015 at 11:32 AM, Helmut Jarausch
<jarausch@igpm.rwth-aachen.de> wrote:
> Hi,
>
> after the last upgrade (GIT 27.06.2015) the following doesn't work anymore.
>
> If I paste some lines (including end-of-line) into an xterm the commands aren't executed unless
> I enter <ENTER> on my keyboard in addition.
>
> Is this an intended change? I didn't change my installed xterm for quite a while.

If you do indeed want to revert this change, the following in your
.zshrc should do the trick:
unset zle_bracketed_paste

and it's harmless to have this in the rc for older zsh version too.

-- 
Mikael Magnusson


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

* Re: Pasting a line end doesn't work anymore
  2015-06-30 16:20         ` Ray Andrews
@ 2015-06-30 17:35           ` Bart Schaefer
  2015-06-30 19:17             ` Ray Andrews
  0 siblings, 1 reply; 10+ messages in thread
From: Bart Schaefer @ 2015-06-30 17:35 UTC (permalink / raw)
  To: zsh-users

On Jun 30,  9:20am, Ray Andrews wrote:
}
} I see. so zsh running in an xterm just sits there with it's mouth open 
} eating characters as normal, and if it's force-fed via a cut and paste 
} there's no obvious way for it to know the difference. So how was that 
} changed?

Terminal emulators gained a capability called "bracketed paste" where
they send a control sequence (similar to pressing a function key) at
the start of a paste, and a different control sequence at the end.

Oliver added ZLE widgets to recognize those two control sequences, plus
ZLE startup/shutdown actions that tell the emulator to enter/leave the
"bracketed paste mode" so that it will invoke the widgets.

You could previously do this yourself with zle-line-init/zle-line-finish
plus two other user-defined widgets, but the change makes it built-in
and automatic.


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

* Re: Pasting a line end doesn't work anymore
  2015-06-30 17:35           ` Bart Schaefer
@ 2015-06-30 19:17             ` Ray Andrews
  0 siblings, 0 replies; 10+ messages in thread
From: Ray Andrews @ 2015-06-30 19:17 UTC (permalink / raw)
  To: zsh-users

On 06/30/2015 10:35 AM, Bart Schaefer wrote:
> On Jun 30,  9:20am, Ray Andrews wrote:
> }
> } I see. so zsh running in an xterm just sits there with it's mouth open
> } eating characters as normal, and if it's force-fed via a cut and paste
> } there's no obvious way for it to know the difference. So how was that
> } changed?
>
> Terminal emulators gained a capability called "bracketed paste" where
> they send a control sequence (similar to pressing a function key) at
> the start of a paste, and a different control sequence at the end.
>
> Oliver added ZLE widgets to recognize those two control sequences, plus
> ZLE startup/shutdown actions that tell the emulator to enter/leave the
> "bracketed paste mode" so that it will invoke the widgets.
>
> You could previously do this yourself with zle-line-init/zle-line-finish
> plus two other user-defined widgets, but the change makes it built-in
> and automatic.

I see, that's quite understandable.  Like so many other things, it's 
beyond me how the previous situation could have been tolerated. I'll 
never understand the culture.
>


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

end of thread, other threads:[~2015-06-30 19:17 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-30  9:32 Pasting a line end doesn't work anymore Helmut Jarausch
2015-06-30 10:10 ` Peter Stephenson
2015-06-30 15:03   ` Ray Andrews
2015-06-30 15:42     ` Peter Stephenson
2015-06-30 15:48       ` Bart Schaefer
2015-06-30 16:20         ` Ray Andrews
2015-06-30 17:35           ` Bart Schaefer
2015-06-30 19:17             ` Ray Andrews
2015-06-30 16:05       ` Ray Andrews
2015-06-30 16:39 ` Mikael Magnusson

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