Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Because often I need to highlight text in the terminal, copy it, then highlight text somewhere else (e.g. in a text input field in a browser, the address bar in the browser, etc.) and paste over it. Selecting the specific destination text I want to overwrite blows away my previous selection.

In many cases I do just highlight and right-click where I want the text pasted. But that workflow doesn't work a large portion of the time and I need a clipboard that isn't being wiped out almost any time I click on something.



I've been using Pop_OS for the past few months, and haven't had any issues resembling this whatsoever. Of course my clipboard gets overwritten if I don't use a utility that saves previous text selections, but I don't recall this being a feature in any of the Windows/Mac/Linux Operating Systems by default.


> Selecting the specific destination text I want to overwrite blows away my previous selection.

Oof, is this the normal Linux behavior? That sounds annoying. In MacOS every app (or even tab) has its own separate highlight that it maintains. So in your example, selecting text in the browser would leave the terminal unaffected, and when you bring the terminal back to the foreground your text is still highlighted.


The highlight doesn't vanish, the clipboard contents do, because that's global and it gets written on highlight.


Nitpick: You're talking about the primary selection, not the clipboard. Those are two different distinct things.


It doesn't surprise me to learn that at all, because I've been confused about having two clipboards in Linux. But I don't remember hearing the term "primary selection" - my interpretation of the behavior was that there are just two separate clipboards. I guess that's not accurate - why not?


X11 supports this with a secondary selection. Unfortunately this functionality isn't exposed in any modern UI toolkits. It does work with Motif apps though.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: