-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Copy/paste does not work between other windows and extraterm on Linux #195
Comments
Here copying between VSCode and Firefox to Extraterm works as expected. Can you tell which application and which actions are needed exactly to see this problem? |
I've tried these - xterm, mrxvt terminal emulator. Eterm terminal emulator. terminator terminal emulator, emacs
This also works - between windows other than extraterm:
Also highlight text in extraterm and paste in extraterm works. It looks as if extraterm is not using the X11 provided buffers for paste. |
Thanks for the detailed info. This is a classic case of X11 having two clipboards. It has a "clipboard" clipboard and a "selection" clipboard. Extraterm only uses the "clipboard" clipboard. (In fact I can't change this. The platform that Extraterm is built on only supports that one clipboard.) Selecting text in xterm and pasting elsewhere using the middle mouse button uses the "selection" clipboard. You can probably still copy text from xterm but first you have to press some shortcut to copy it to the real clipboard. KDE and perhaps other desktops, have default tools which keep the two X11 clipboards in sync. I don't know which desktop you are using, but running a tool to do the syncing is one possible solution other than explicitly copying to the main clipboard via a shortcut or similar. |
@sedwards2009 are you talking about electron? According to the documentation, it looks like the "selection" clipboard is supported as well: https://www.electronjs.org/docs/api/clipboard
const { clipboard } = require('electron')
clipboard.writeText('Example String', 'selection')
console.log(clipboard.readText('selection')) Is so, could you please consider to re-open this issue, as it is really disappointing for linux users ? |
More than disappointing. It makes Extraterm a non-starter for many Linux users. This is basic X11 functionality. |
@Toub Yes I am talking about Electron. There has been a lot of refinement of the clipboard API in Electron since I did the initial clipboard support. That is a good find in the API docs and I'll be happy to look at it again. |
Great! I had a look at the code, and the clipboard selection option is available in clipboard methods you use in I guess you will have to duplicate IPC messages (CLIPBOARD_WRITE...). I am an absolute newbie with Electron but I would be happy to help if I can find a bit of time. |
The simplest thing I can do is when doing a copy inside Extraterm, to copy the text to both clipboards at the same time. When pasting text, I can fall back to the 'selection' clipboard if the primary one is empty. But that might not be what you want. The alternative is to add config options for supporting the whole X11 style "selection" clipboard on selection and mouse paste, and the normal clipboard for the rest. But I would like to avoid that if possible. There are only a handful of applications these days which use the X11 'selection' clipboard though. |
Thanks for your answer.
Yes, that's what we need, to have a consistent behavior between the console and other applications.
Why? Because it is technically hard, or because you don't want to introduce a new option nor change the current default behavior?
Are you sure? I think that all applications I use everyday support 'selection' clipboard: firefox, vscode, terminator, file explorer, geany text editor, dbeaver (sql gui client)... Please find more detail bellow: ==> COPY Currently, when I select a text inside Extraterm, it copy it to both buffer (so I can paste it using mouse button OR +v).
This won't change anything since the selection is already pasted in both buffers. Is it technically possible to have the following behavior:
Are we able to make a difference between this 2 events? ==> PASTE Currently, when I paste a text a text inside Extraterm (using mouse button OR +v), the text is always pasted from the main buffer, never the selection one. This is the most annoying issue, as most of the time, when I copy/paste to the terminal, I use the fast method using the
No, that's not. Most of the time there are content in both buffers. Is it technically possible to have the following behavior:
Are we able to make a difference between this 2 events? By the way, congratulations for this great project. I really love it and I consider to use it as default terminal emulator if I can solve this issue. Moreover, as a typescript developer, I would be happy to contribute. |
By the way, it can be interesting to have a look at
|
@Toub Thank you for the detailed answer. I'm hesitant to just add stuff that is only going to affect such a (IMO) small group of people, and may "clutter up" the application. I think that few Linux users are even aware of the two clipboards. I've been using Linux on the desktop since the 90s and haven't been reminded of the X11 clipboard set up for decades. Linux desktop environments have been hiding the two clipboards for a long time already. That said, one of the my principles for this project is to not ask people to change their terminal habits or workflows if they don't want to, unless it is really unavoidable. Here's the plan:
That should cover your request. It is also possible to add a command to "Copy to selection clipboard" which people could then bind their own keyboard shortcuts to, but that doesn't sound necessary if I understand correctly. Help on this project is welcome, but it is hard to say "where" exactly help is needed. In intend to keep expanding the Extension API and to more more things into extensions. Extensions will be an area where it is much much easier for new people to get involved. |
I understand.
This is probably not necessary, because currently, the selection is already copied to So, this is current behavior, even when "Automatically copy selection to clipboard" is not checked. Nothing to do here.
Electron documentation is not clear about what appends when you call If I am right, no need to add an option, but simply always calling In that case, there is very few thing to do: just always call this method when using this action:
Yes, that cover the COPY behavior part of my request, but this is not the more important, as the "Automatically copy selection to clipboard" workaround is not ideal, but acceptable for now.
Right. My main problem is the PASTE behavior. But as for COPY, this is probably not necessary to add an option for that, depending of Electron In that case, there is very few thing to do: just always call this method when using this action:
Yes, that's a good idea. To begin, I will try to use |
Sorry. I screwed up my last post. I meant to say: "Add a "Paste from 'selection' clipboard" option to the mouse button configuration. |
To summerise:
|
Yes, that's the most important part (but as explained before, probably not necessary to add an option, depending of electron implementation)
It is the current behavior. |
@Toub This little feature is now in the nightly build. You can grab a package from here and test it out: https://storage.googleapis.com/extraterm_builds/index.html |
Thanks! After activating the option, the copy from selection using middle click works. Thanks. Could we make it the default? What appends when you use this option on a non-compatible system? This is better than before, but there is a related issue:
So, whatever the paste method I use, I always use one of my clipboards. Is there a reason why the text is automatically selected? It is not a common behavior in other terminals. Could we disable this? |
The ability to copy-paste text with one hand and just two presses is the main driver to stay on Linux, because it such a huge burst in productivity comparing to other OS'es. It's literary 3x faster than select by mouse -> Ctrl-C -> click by mouse -> Ctrl-V. All Linux users, which I know, are aware about two-independent-clipboards-feature. Please, don't ruin our user experience. If you use Windows, you can try https://autoclipx.en.softonic.com/ , https://dragking.en.softonic.com/ , http://fy.chalmers.se/~appro/nt/TXMouse/ . I think that few Windows users are even aware of the two clipboards. |
I know this topic has been dormant for awhile but I just tried extratermqt and left mouse copy to selection then paste from selection does not work. It looks like the selected text is copied to the clipboard but not the selection. Is there a config option I am missing? |
Hi, I just installed Extraterm (QT 0.69) and I'm experiencing the same problem that @caedmon-kitty there It appears that Extraterm always copy the selection in the "main" clipboard, not the selection clipboard so I guess it's a bug. |
On Linux the mouse in combination with a mouse button is used to highlight text and that text is copied. Then another mouse button pastes the copied text into the current windows. I normally use this to copy long commands from one terminal window to another or from one application to another.
This works correctly in all cases except extraterm. It works within extraterm. I can copy some text in the extraterm wiindow and paste it in the same window without problems.
But when I/copy some text in other windows and then try to paste into extraterm instead the last text I copied in extraterm is pasted. All of my text copies outside of extraterm are ignored.
The text was updated successfully, but these errors were encountered: