annoying PasteStart/PasteEnd

253 views
Skip to first unread message

Johannes-Maria Kaltenbach

unread,
Jan 23, 2017, 7:58:03 AM1/23/17
to vim...@googlegroups.com
Hello,

I just updated vim from 8.0.197 to 8.0.222 and now I
always get a very annoying <PasteStart> before and
<PasteEnd> after anything I paste with the mouse
(middle button) in an xterm on Unix (BSD).
How can I get rid of this 'feature'?

Best regards,
Johannes-Maria


Christian Brabandt

unread,
Jan 23, 2017, 8:10:15 AM1/23/17
to vim...@googlegroups.com
Hi Johannes-Maria!

On Mo, 23 Jan 2017, Johannes-Maria Kaltenbach wrote:

> Hello,
>
> I just updated vim from 8.0.197 to 8.0.222 and now I
> always get a very annoying <PasteStart> before and
> <PasteEnd> after anything I paste with the mouse
> (middle button) in an xterm on Unix (BSD).
> How can I get rid of this 'feature'?

Patch 210 added bracketed paste support to Vim. It's likely something
isn't working for you. To disable this feature do:
:set t_BE=

This is only a workaround, but I don't know why you would get
<PasteStart>/<PasteEnd> markers. Are you possibly using a bracketed
paste plugin?

Best,
Christian
--
Offen steht das Grab! Welch herrlich Wunder!
Der Herr ist auferstanden! - Wer's glaubt!
Schelmen, ihr trugt ihn ja weg.
-- Johann Wolfgang von Goethe (Epigramme)

Johannes-Maria Kaltenbach

unread,
Jan 23, 2017, 8:49:28 AM1/23/17
to vim...@googlegroups.com
Hi Christian,

On Mon, Jan 23, 2017 at 02:10:08PM +0100, Christian Brabandt wrote:
> > I just updated vim from 8.0.197 to 8.0.222 and now I
> > always get a very annoying <PasteStart> before and
> > <PasteEnd> after anything I paste with the mouse
> > (middle button) in an xterm on Unix (BSD).
> > How can I get rid of this 'feature'?
>
> Patch 210 added bracketed paste support to Vim. It's likely something
> isn't working for you. To disable this feature do:
> :set t_BE=

Thanks, this helped.

[FYI: it had no effect when given directly in the vim-session
as an ex-command :set t_BE=, but when I added it to my ~/.exrc.]

> This is only a workaround, but I don't know why you would get
> <PasteStart>/<PasteEnd> markers. Are you possibly using a bracketed
> paste plugin?

no; and removing all plugins didn't change this behaviour.


Thanks very much,
Johannes-Maria



Bram Moolenaar

unread,
Jan 23, 2017, 2:46:29 PM1/23/17
to vim...@googlegroups.com, Johannes-Maria Kaltenbach

Johannes-Maria Kaltenbach wrote:

> I just updated vim from 8.0.197 to 8.0.222 and now I
> always get a very annoying <PasteStart> before and
> <PasteEnd> after anything I paste with the mouse
> (middle button) in an xterm on Unix (BSD).
> How can I get rid of this 'feature'?

Support for bracketed paste was added, it is supposed to make paste work
better.

I cannot see the problem. Can you say what exactly you do?
What is your 'mouse' setting?

--
LAUNCELOT leaps into SHOT with a mighty cry and runs the GUARD through and
hacks him to the floor. Blood. Swashbuckling music (perhaps).
LAUNCELOT races through into the castle screaming.
SECOND SENTRY: Hey!
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Johannes-Maria Kaltenbach

unread,
Jan 24, 2017, 7:26:28 AM1/24/17
to vim...@googlegroups.com, Bram Moolenaar
On Mon, Jan 23, 2017 at 08:46:16PM +0100, Bram Moolenaar wrote:
>
> Johannes-Maria Kaltenbach wrote:
>
> > I just updated vim from 8.0.197 to 8.0.222 and now I
> > always get a very annoying <PasteStart> before and
> > <PasteEnd> after anything I paste with the mouse
> > (middle button) in an xterm on Unix (BSD).
> > How can I get rid of this 'feature'?
>
> Support for bracketed paste was added, it is supposed to make paste work
> better.
>
> I cannot see the problem. Can you say what exactly you do?
> What is your 'mouse' setting?

no setting.
('verbose set mouse' just returns 'mouse='.)

I don't use gvim, only vim in an xterm.
and just use the mouse as usual in X windows.

When I yank something (left mouse butten), e. g. 'xxx',
and paste it (with the middle mouse butten) then the xxx
is surrounded by <PasteStart> and <PasteEnd>:

<PasteStart>xxx<PasteEnd>

I've got rid of this with Christian's help by adding
'set t_BE=' to my .exrc.


I only found out today that this occurs only in the
command line (:) or search (/, ?), not when writing
to the buffer.

Best regards,
Johannes-Maria


Bram Moolenaar

unread,
Jan 24, 2017, 8:51:08 AM1/24/17
to Johannes-Maria Kaltenbach, vim...@googlegroups.com
Whatever I try I cannot reproduce it.

Does this still happen when you start Vim with:

vim -u NONE -N

When not resetting t_BE, of course.

--
Futility Factor: No experiment is ever a complete failure - it can always
serve as a negative example.

Johannes-Maria Kaltenbach

unread,
Jan 24, 2017, 9:02:11 AM1/24/17
to vim...@googlegroups.com, Bram Moolenaar
yes


Best regards,
Johannes-Maria


François Ingelrest

unread,
Jan 24, 2017, 9:13:11 AM1/24/17
to vim...@googlegroups.com
On 24 January 2017 at 15:02, Johannes-Maria Kaltenbach
<johanne...@t-online.de> wrote:
>> Whatever I try I cannot reproduce it.
>>
>> Does this still happen when you start Vim with:
>>
>> vim -u NONE -N
>>
>> When not resetting t_BE, of course.
>
> yes

I've just updated vim to 8.226 and get the same issue. Works fine in
the buffer window, but not in the command line. This is with Vim
running in a gnome terminal.

Bram Moolenaar

unread,
Jan 24, 2017, 9:58:28 AM1/24/17
to Johannes-Maria Kaltenbach, vim...@googlegroups.com
Found it: part of the change was missing from the patch.
So it worked for me but nobody else.

--
I still remember when I gave up Smoking, Drinking and Sex. It was the
most *horrifying* hour of my life!

Tom Snee

unread,
Jan 24, 2017, 11:37:21 AM1/24/17
to vim_use, johanne...@t-online.de
On Tuesday, January 24, 2017 at 8:51:08 AM UTC-5, Bram Moolenaar wrote:
> Does this still happen when you start Vim with:
>
> vim -u NONE -N
>
> When not resetting t_BE, of course.

It happens for me, but only when I paste in command line mode. Changing t_BE makes no difference. I use Jonathon Fernyhough's Ubuntu vim as described at https://launchpad.net/~jonathonf/+archive/ubuntu/vim

Johannes-Maria Kaltenbach

unread,
Jan 25, 2017, 7:53:58 AM1/25/17
to vim...@googlegroups.com, Bram Moolenaar
On Tue, Jan 24, 2017 at 03:58:14PM +0100, Bram Moolenaar wrote:
> Found it: part of the change was missing from the patch.
> So it worked for me but nobody else.

Thanks.
I've updated now to vim-8.0.237 and it works fine.

Best regards,
Johannes-Maria


Johannes-Maria Kaltenbach

unread,
Jan 26, 2017, 5:44:21 AM1/26/17
to vim...@googlegroups.com
On Wed, Jan 25, 2017 at 01:53:54PM +0100, Johannes-Maria Kaltenbach wrote:
> On Tue, Jan 24, 2017 at 03:58:14PM +0100, Bram Moolenaar wrote:
> > Found it: part of the change was missing from the patch.
> > So it worked for me but nobody else.
>
> Thanks.
> I've updated now to vim-8.0.237 and it works fine.

but (at least for me) it is better to keep 'set t_BE=' in the
configuration file. The <PasteStart>/<PasteEnd> around pasted
text is gone but if one yanks a whole line (or part of the line
until the end of the line) with the mouse and pastes it in an
xterm then the pasted text contains a ^M at the end instead
of executing a 'return' (as was the old behaviour and the one
I prefer instead of first deleting the ^M and then pressing
return).
[Only in command line (including searches), not while inserting
in buffer.]

Best regards,
Johannes-Maria



Bram Moolenaar

unread,
Jan 26, 2017, 2:40:35 PM1/26/17
to vim...@googlegroups.com, Johannes-Maria Kaltenbach
I assume you are talking about the command line, or entering search.
Yes, it's intentional that the line break does not work like pressing
Enter. The idea is that you are pasting text, not a command.
You are supposed to view the text before deciding to execute it.
The thread that started it mentioned that the source of the text may
give you something else than what you expected. In practice, what often
happens is that you accidentally copy the wrong text and include the
line break when that is not intended.

--
ARTHUR: Be quiet!
DENNIS: --but by a two-thirds majority in the case of more--
ARTHUR: Be quiet! I order you to be quiet!
WOMAN: Order, eh -- who does he think he is?
ARTHUR: I am your king!
The Quest for the Holy Grail (Monty Python)

Johannes-Maria Kaltenbach

unread,
Jan 27, 2017, 9:10:11 AM1/27/17
to vim...@googlegroups.com, Bram Moolenaar
On Thu, Jan 26, 2017 at 08:40:27PM +0100, Bram Moolenaar wrote:
>
> Johannes-Maria Kaltenbach wrote:
>
> > On Wed, Jan 25, 2017 at 01:53:54PM +0100, Johannes-Maria Kaltenbach wrote:
> > > On Tue, Jan 24, 2017 at 03:58:14PM +0100, Bram Moolenaar wrote:
> > > > Found it: part of the change was missing from the patch.
> > > > So it worked for me but nobody else.
> > >
> > > Thanks.
> > > I've updated now to vim-8.0.237 and it works fine.
> >
> > but (at least for me) it is better to keep 'set t_BE=' in the
> > configuration file. The <PasteStart>/<PasteEnd> around pasted
> > text is gone but if one yanks a whole line (or part of the line
> > until the end of the line) with the mouse and pastes it in an
> > xterm then the pasted text contains a ^M at the end instead
> > of executing a 'return' (as was the old behaviour and the one
> > I prefer instead of first deleting the ^M and then pressing
> > return).
> > [Only in command line (including searches), not while inserting
> > in buffer.]
>
> I assume you are talking about the command line, or entering search.

yes, both.

> Yes, it's intentional that the line break does not work like pressing
> Enter. The idea is that you are pasting text, not a command.

OK, so in the case of the end-of-line it was intended.

> You are supposed to view the text before deciding to execute it.
> The thread that started it mentioned that the source of the text may
> give you something else than what you expected. In practice, what often
> happens is that you accidentally copy the wrong text and include the
> line break when that is not intended.

Personally I prefer like it was in earlier versions
but that's no problem since I can have this with 'set t_BE='.

Thanks,
Johannes-Maria


Reply all
Reply to author
Forward
0 new messages