why is cut and paste broken on X11?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

why is cut and paste broken on X11?

Ruben Safir
Why is it that X11 cut and paste has been broken for a couple of years
now and that it is not being fixed.  It worked fine for 30 years.

WHy can't I get rid of Visual mode which is a huge failure.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: why is cut and paste broken on X11?

Christian Brabandt

On Mo, 06 Aug 2018, [hidden email] wrote:

> Why is it that X11 cut and paste has been broken for a couple of years
> now and that it is not being fixed.  It worked fine for 30 years.

No, it is not. Perhaps you need to have a look at the documentation?
I suppose you are looking for `:set mouse=`

> WHy can't I get rid of Visual mode which is a huge failure.

I am sorry, but ranting is neither helpful not appreciated. Plus it
won't fix it. Also it is always helpful to send a complete reproducible
example.

Best,
Christian
--
Warum hacken immer alle auf mir rum?

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: why is cut and paste broken on X11?

Ruben Safir
On 08/06/2018 11:04 AM, Christian Brabandt wrote:
> No, it is not

yes it is

> I suppose you are looking for `:set mouse=`

That only works sometimes and doesn't fix that it is broken, which it
wasn't 5 years ago.

> I am sorry, but ranting is neither helpful not appreciated.

Agreed, so don't rant.

Ruben
--
So many immigrant groups have swept through our town
that Brooklyn, like Atlantis, reaches mythological
proportions in the mind of the world - RI Safir 1998
http://www.mrbrklyn.com

DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002
http://www.nylxs.com - Leadership Development in Free Software
http://www2.mrbrklyn.com/resources - Unpublished Archive
http://www.coinhangout.com - coins!
http://www.brooklyn-living.com

Being so tracked is for FARM ANIMALS and and extermination camps,
but incompatible with living as a free human being. -RI Safir 2013

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: why is cut and paste broken on X11?

Ruben Safir
In reply to this post by Christian Brabandt
On 08/06/2018 11:04 AM, Christian Brabandt wrote:

>
> On Mo, 06 Aug 2018, [hidden email] wrote:
>
>> Why is it that X11 cut and paste has been broken for a couple of years
>> now and that it is not being fixed.  It worked fine for 30 years.
>
> No, it is not. Perhaps you need to have a look at the documentation?
> I suppose you are looking for `:set mouse=`
>
>> WHy can't I get rid of Visual mode which is a huge failure.
>
> I am sorry, but ranting is neither helpful not appreciated. Plus it
> won't fix it. Also it is always helpful to send a complete reproducible
> example.
>
> Best,
> Christian
>
https://unix.stackexchange.com/questions/139578/copy-paste-for-vim-is-not-working-when-mouse-set-mouse-a-is-on



--
So many immigrant groups have swept through our town
that Brooklyn, like Atlantis, reaches mythological
proportions in the mind of the world - RI Safir 1998
http://www.mrbrklyn.com

DRM is THEFT - We are the STAKEHOLDERS - RI Safir 2002
http://www.nylxs.com - Leadership Development in Free Software
http://www2.mrbrklyn.com/resources - Unpublished Archive
http://www.coinhangout.com - coins!
http://www.brooklyn-living.com

Being so tracked is for FARM ANIMALS and and extermination camps,
but incompatible with living as a free human being. -RI Safir 2013

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: why is cut and paste broken on X11?

Tony Mechelynck
Well, I can't speak for you, but I've been using gvim (with GTK2 GUI)
for years on X11 and for me copy, cut and paste work with no problems.
The workings of the X11 clipboard may have to need some getting used
to for someone raised and bred on Windows, though, because it doesn't
work exactly the same way as the Windows clipboard.

- Of course, your Vim has to be compiled with +clipboard but if it's a
GUI it usually is.
- There are actually more than one separate "clipboards" on X11. One
of them is called "selection" in the X11 documentation: it is set by
most programs (but usually not Vim) as soon as you select something
visually and its contents can be pasted by a middle-click. To Vim,
this is the * (star) register, set by "*d "*y or :d* :y* and pasted by
"*p "*P or :put * This is usually not the one I use, except when I
need to paste into xterm, which doesn't know the other one.
- The other one is called "clipboard" in the X11 documentation and it
is used in all programs I know (including gvim) by Edit→Copy, Edit→Cut
and Edit→Paste. In addition, Vim knows it as the + register and uses
it with "+y "+d "+p "+P :y+ :d+ and :put +
- These two registers work best in gvim because when running Vim
(compiled, of course, with +x11 +clipboard) in an X11-aware terminal,
the terminal may (depending on which terminal application you are
using) steal selections and middle clicks and not let Vim see them. In
addition, usually neither of them works in tty1..tty6 (usually
accessed by Ctrl-Alt-F1..Ctrl-Alt-F6 and left by Ctrl-Alt-F7) because
these "Linux consoles" have no connection to the X11 server.
- When copying, cutting and pasting (sorry, in Vim language it is
yanking, deleting and putting, respectively) within a single instance
of Vim it is possible (and I recommend) to bypass the X11 selection &
clipboard completely, and use either the default register for
temporary use, or the 26 lettered registers "a to "z for stuff you may
want to remember, and put again and again at different places in
different edit files. I also find it handy to reserve register q for
macros, started (in that case) by qq then doing something in Normal
mode, and an additional q stops the registering.
- I usually set the 'clipboard' option to just "exclude:cons\|linux"
i.e. either :set cb-=autoselect or :set cb=exclude:cons\\\|linux (see
:h option-backslash about the backslash-escapes) so Vim will leave the
X11 selection well enough alone unless I explicitly say I want to use
it. For the same reason I keep the a and P flags out of 'guioptions'
(in my case I use :set go=!cgimrLtTp but YMMV).

Best regards,
Tony.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: why is cut and paste broken on X11?

Christian Brabandt
In reply to this post by Ruben Safir

On Mo, 06 Aug 2018, Ruben Safir wrote:

> On 08/06/2018 11:04 AM, Christian Brabandt wrote:
> > No, it is not
>
> yes it is

Proof by assertion.

> > I suppose you are looking for `:set mouse=`
>
> That only works sometimes and doesn't fix that it is broken, which it
> wasn't 5 years ago.

So how a proper reproducible bug report then?


Best,
Christian

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: why is cut and paste broken on X11?

Tim Chase
In reply to this post by Ruben Safir
On 2018-08-06 07:58, [hidden email] wrote:
> Why is it that X11 cut and paste has been broken for a couple of
> years now and that it is not being fixed.  It worked fine for 30
> years.

To begin with, mouse works perfectly fine in vim and is configurable
for how exactly it does work.  You'll want to read up at

  :help 'mouse'

to learn about the options.

Also, you don't provide sufficient information to replicate your
issue.  To get any sort of assistance, it would help if you provide

1) what behavior you expect

2) what behavior you experience

3) whether you're running gvim or vim-in-a-terminal (and if so, which
terminal)

4) whether you're talking about the X selection buffer (usually
filled by selecting something with your mouse and pasted with the
middle-mouse-button) or the X clipboard buffer (usually accessed by
the Edit→{Copy/Cut/Paste} menu option or Control+{X/C/V})

5) your settings for a number of relevant options:

   :set mouse? mousef? mh? mousem? mouset? sel? slm?

> WHy can't I get rid of Visual mode which is a huge failure.

While it may feel like a failure on your part, with answers to the
above questions, folks on the list can help you succeed.

-tim






--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: why is cut and paste broken on X11?

Gary Johnson-4
In reply to this post by Tony Mechelynck
On 2018-08-06, Tony Mechelynck wrote:
> Well, I can't speak for you, but I've been using gvim (with GTK2 GUI)
> for years on X11 and for me copy, cut and paste work with no problems.

I generally run vim in an xterm on X11, but I've also done so for
years with copy, cut and paste working fine.

> The workings of the X11 clipboard may have to need some getting used
> to ....

I got frustrated with the two X11 cut buffers and having to think
about which held what and how to access each one, so I now install
a clipboard manager, either autocutsel or Parcellite, on my systems
running X11 and configure it to sync the clipboard with the
primary selection.

I also have the following in my ~/.vimrc so that everything I yank
to the unnamed register is copied to the clipboard and everything
copied to clipboard from other applications is also copied to the
unnamed register.  This can be annoying at times, but it is handy
more often than annoying, so it works well for me.

    if has("clipboard")
        set clipboard^=unnamed

Regards,
Gary

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: why is cut and paste broken on X11?

Ruben Safir
In reply to this post by Tony Mechelynck
On Monday, August 6, 2018 at 1:08:10 PM UTC-4, Tony Mechelynck wrote:

> Well, I can't speak for you, but I've been using gvim (with GTK2 GUI)
> for years on X11 and for me copy, cut and paste work with no problems.
> The workings of the X11 clipboard may have to need some getting used
> to for someone raised and bred on Windows, though, because it doesn't
> work exactly the same way as the Windows clipboard.
>
> - Of course, your Vim has to be compiled with +clipboard but if it's a
> GUI it usually is.
> - There are actually more than one separate "clipboards" on X11. One
> of them is called "selection" in the X11 documentation: it is set by
> most programs (but usually not Vim) as soon as you select something
> visually and its contents can be pasted by a middle-click. To Vim,
> this is the * (star) register, set by "*d "*y or :d* :y* and pasted by
> "*p "*P or :put * This is usually not the one I use, except when I
> need to paste into xterm, which doesn't know the other one.
> - The other one is called "clipboard" in the X11 documentation and it
> is used in all programs I know (including gvim) by Edit→Copy, Edit→Cut
> and Edit→Paste. In addition, Vim knows it as the + register and uses
> it with "+y "+d "+p "+P :y+ :d+ and :put +
> - These two registers work best in gvim because when running Vim
> (compiled, of course, with +x11 +clipboard) in an X11-aware terminal,
> the terminal may (depending on which terminal application you are
> using) steal selections and middle clicks and not let Vim see them. In
> addition, usually neither of them works in tty1..tty6 (usually
> accessed by Ctrl-Alt-F1..Ctrl-Alt-F6 and left by Ctrl-Alt-F7) because
> these "Linux consoles" have no connection to the X11 server.
> - When copying, cutting and pasting (sorry, in Vim language it is
> yanking, deleting and putting, respectively) within a single instance
> of Vim it is possible (and I recommend) to bypass the X11 selection &
> clipboard completely, and use either the default register for
> temporary use, or the 26 lettered registers "a to "z for stuff you may
> want to remember, and put again and again at different places in
> different edit files. I also find it handy to reserve register q for
> macros, started (in that case) by qq then doing something in Normal
> mode, and an additional q stops the registering.
> - I usually set the 'clipboard' option to just "exclude:cons\|linux"
> i.e. either :set cb-=autoselect or :set cb=exclude:cons\\\|linux (see
> :h option-backslash about the backslash-escapes) so Vim will leave the
> X11 selection well enough alone unless I explicitly say I want to use
> it. For the same reason I keep the a and P flags out of 'guioptions'
> (in my case I use :set go=!cgimrLtTp but YMMV).
>
> Best regards,
> Tony.
Thank you, this explains a lot.  It is the selection that is failing to work and the clipboard I can only wish to get rid of it altogether.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: why is cut and paste broken on X11?

Ruben Safir
In reply to this post by Tony Mechelynck

> - When copying, cutting and pasting (sorry, in Vim language it is
> yanking, deleting and putting, respectively) within a single instance
> of Vim it is possible (and I recommend) to bypass the X11 selection &
> clipboard completely, and use either the default register for
> temporary use,


No - that right there is the cause for the great disconcertion of every individual I know using vim right now.  The cutting and pasting is not the yanks and put of VIM.  VIM should get out of the way and like the terminal and X do it...

You put it in input moved and middle click in..

You select and it can now be middle mouse button entered in to any other X11 device.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: why is cut and paste broken on X11?

Tony Mechelynck
On Mon, Aug 6, 2018 at 8:10 PM,  <[hidden email]> wrote:

>
>> - When copying, cutting and pasting (sorry, in Vim language it is
>> yanking, deleting and putting, respectively) within a single instance
>> of Vim it is possible (and I recommend) to bypass the X11 selection &
>> clipboard completely, and use either the default register for
>> temporary use,
>
>
> No - that right there is the cause for the great disconcertion of every individual I know using vim right now.  The cutting and pasting is not the yanks and put of VIM.  VIM should get out of the way and like the terminal and X do it...
>
> You put it in input moved and middle click in..
>
> You select and it can now be middle mouse button entered in to any other X11 device.

I see... Well, for that (excuse my language) there is a simple answer:
find yourself a Vim compiled with -x11, that one will only work in
Console mode and it will not hamper the terminal's grabbing of all
your selections and middle-clicks. If you can't find one precompiled,
you can compile it yourself; just be sure to include --disable-gui
--without-x among the configure options. In addition (but I'm less
sure about that) you may have to add the following in your vimrc:

        :map <MiddleMouse> <Nop>
        :map! <MiddleMouse> <Nop>

Best regards,
Tony.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: why is cut and paste broken on X11?

John Little-4
In reply to this post by Christian Brabandt
On Mo, 06 Aug 2018, [hidden email] wrote:

> Why is it that X11 cut and paste has been broken for a couple of years
> now and that it is not being fixed.  It worked fine for 30 years.

What OS and desktop environment do you use?  Vim's use of the selection and the clipboard didn't change at all, but in KDE I noticed a change in behaviour with plasma 5, in that I often found the selection and the clipboard were different and not what I wanted.  The clipboard "plasmoid" has a setting to synchronize them, which works well with ASCII but can give problems otherwise due to historic X11 brokenness.  Vim has many settings to cope with this, I suggest you have a look at :help 'clipboard'.  So your change in behaviour might be in X or a clipboard manager.  With Wayland coming I don't know what will happen.

Another source of trouble in recent years, if you use vim rather than gvim, is "bracketed paste mode".  IMO vim has been on top of this, but the implementations in various terminal emulators have had problems.  Many emulators claim to emulate an xterm but how well varies.

Regards, John Little

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.