edit: Can't copy content outside the application

Ubuntu 24.04, zsh terminal. The application appears to have its own clipboard, and this behavior is quite strange and unintuitive. The situation:

  • I am in the editor, and I want to copy text from the editor to another application. So I copy the text with <kbd>Ctrl</kbd> + <kbd>c</kbd> or Edit > Copy.
  • Then, I attempt to paste in another application. It doesn’t paste anything or it pastes whatever was last copied elsewhere in the system.
  • I can, however, paste within the application using <kbd>Ctrl</kbd> + <kbd>v</kbd> or Edit > Paste

Conversely, I can paste from outside in.

  • I copy text from another application.
  • I open the editor and attempt to paste with <kbd>Ctrl</kbd> + <kbd>v</kbd> or Edit > Paste. It doesn’t work. This is to be expected for terminal-based applications, since <kbd>Ctrl</kbd> + <kbd>v</kbd> has its own function in the terminal (disregarding that edit overrides this keyboard shortcut to act on its own clipboard; I’m just coming from the perspective of any other terminal application).
  • I use instead <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>v</kbd>, and this does paste from the system clipboard as expected for a terminal application.

Is it possible to make <kbd>Ctrl</kbd> + <kbd>c</kbd> only work on the application clipboard, but <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>c</kbd> works on the system clipboard? This would be consistent with what I would expect from a terminal app that’s also working as a standard GUI text editor.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 2
  • Comments: 15 (5 by maintainers)

Most upvoted comments

I think OSC 52 needs to be explicitly enabled in tmux. Have you checked your settings? And if you’re using ssh you’d have to run it on the client, not the host. If you’re using it on the host to preserve sessions, hopefully it will pass the sequence through to the client if the setting isn’t enabled on the host.