+26

Selecting text doesn't update the X selection buffer (Linux)

Jamie Webb 6 years ago • updated by bjunix 5 years ago 14
Means I can't e.g. middle-click paste into an xterm.

The clipboard is working fine, but many X applications don't use and can't access the clipboard.
+2
Ok, this is definitely a bug (race condition?) rather than just missing behaviour. If I select some text in ST2, it clears the X buffer - it never puts the selected text there. If I then middle-click paste that text within ST2 (which works reliably), that sometimes (with about 30% probability) then causes the text to appear in the X buffer such that I can also paste it into other applications. Repeated pastes into ST2 increase the probability that the text makes it into the X buffer. Quite strange. This is with build 2076 on RHEL5.
+1
For me, Ubuntu 11.4, middle clicking works correctly until you're combining selections from other applications.  I think the problem might be related to sublime keeping a selection if the selection changes from another application. In Linux, you're supposed to only have one selection across all applications. Sublime doesn't honor this.

To reproduce:
1) Select some text in a terminal
2) Open sublime and paste the text with middle click on the location you want the text (works correctly)
3) Type some new text, select it.
4) Go to a terminal, notice that your selection from before is no longer selected (selecting in sublime correctly deselects it, this is standard behavior in linux)
5) Select something new
6) Go back to sublime, notice that your selection has remained (erroneously).
7) Paste using middle click to find that your selection from the terminal pasted.

The confusion is that even though the sublime says something is selected, its actually not in the middle button buffer.  I think Sublime should check to make sure that the selection matches the middle button buffer when a context switch brings sublime into focus and deselect your selection if it doesn't match.
+3
For me (Ubuntu 10.10), double clicking to select a single word in ST2 updates the X selection buffer correctly. Tripple clicking to select a whole line sometimes copies the whole line and at other times just a single word. Selecting by dragging seems to copy only the first 1 or 2 characters. If I make a selection really quickly then it copies the whole lot. I guess ST2 makes the copy a few milliseconds after the selection has started, regardless of whether the mouse is still down or not.
+1
This is still a problem on Linux and it's the most annoying thing. Is it a confirmed bug or something that isn't planned to be fixed?

Using Linux for ~7 years straight now, I never copy anything with "Ctrl-C" nor by right mouse click - and I like it that way. Simply trying to copy something from ST and paste it anywhere else forces me to repeatedly go back in steps after realizing I hadn't actually copied anything. Frustrating... :/

And what's more, I'm beginning to realize how this makes me more and more unsure about having copied stuff simply by selecting text in every other program. And ST is the only one that breaks that behavior (that's also kind of a compliment to ST and you Jon because I'm still using it, even after that ;)).
+2
Same problem here.

Is this issue being tracked? Will it be corrected?

Thank you.
+3

In my opinion this really is a must have for a Linux application.


So I really hope they fix this soon.

please fix this, it is really annoying
+3
I should add that Sublime behaviour is also broken in a couple of other ways wrt X standards:

- Text should be pasted from the selection buffer with either middle-click or shift-ins. In Sublime, shift-ins pastes from the clipboard (i.e. duplicates ctrl-V).

- Deselecting text (clicking away or changing file) should not empty the selection buffer. The buffer should continue to hold the most recently selected text.
+1
I just registered on their forum to post a message about the bug there, if you want you can follow the issue here; http://www.sublimetext.com/forum/viewtopic.php?f=3&t=5837 and it might also be a good idea to post comments that they need to review the issue asap.
+1
I'm running this on 64 bit Xubuntu 11.10.

What I'm seeing is that if I drag a selection with my mouse, right-click/copy or hit ctrl+c and paste (ctrl+v or shift-insert) it somewhere else, then I only part of what I selected gets pasted.

If I do the same selection with click, shift, click, then I get the whole thing.
+1
Yes I have this. Most peculiar - if I select some text in ST2, then middle click to paste it somewhere else, it's missing the first few characters!
+1
Same issue here. If I select something in ST2 and try to paste it with middle button only a few characters made it to the selection buffer.

Copy on select is the very important for my productivity. I love ST2 and if this bug is fixed, it will satisfy all my editor needs.
Woo-hoo! Just tried latest dev build (http://www.sublimetext.com/dev) and the bug seems fixed!

I really started worrying because the power of muscle memory made me use Ctrl-C more often even in other applications... ugh...

Thankfully, I can now finally fully enjoy ST2! Thanks Jon! :)
This issue seems to be fixed in the stable 2.0 release and can be closed (there are also some related issues in the tracker here)