cursive icon indicating copy to clipboard operation
cursive copied to clipboard

Text selection

Open refaelsh opened this issue 5 years ago • 3 comments

Hi,

Is it possible to select text in TextView to be able to ctrl+c it?

Thanks. Refael.

refaelsh avatar Jul 25 '20 20:07 refaelsh

Hi!

Unfortunately I don't know of an easy way to accomplish this. In order to process mouse events, we turn on "mouse mode" in the terminal, which has the effect of disabling the default text selection from dragging the mouse. As you noticed, this prevent the usual selection used to copy text.

To bring back easy copy/paste, we have a few options:

  • Some terminals provide a way to bypass mouse mode and still highlight/copy blocks of text. For example on gnome-terminal you can shift+drag to select text, or shift+ctrl+drag to select a rectangular block of text. This way, you can select arbitrary regions of text in the UI. This works in any application, like cursive, or vim, ...
  • The other solution would be to re-implement selection and copy entirely in cursive itself. The main issue here is that, at best, we could send the selected text to the clipboard, but it wouldn't let you copy/paste from an ssh session (since we would send the content to the clipboard of the server, not the local client).
  • Reading about the xterm escape codes, I see mention of a "mouse highlight mode". It sounds potentially interesting, but I doubt it would solve the issue here: among other things, it seems to only let the application control a span of lines to select, not a span of rows.

gyscos avatar Jul 25 '20 23:07 gyscos

So I stumbled over the same issue. Is it possible to disable the cursive mouse support?

kalkin avatar Apr 16 '21 09:04 kalkin

I will say, sending the text to the local clipboard would still be a great improvement, even if there's no way to directly copy over SSH.

mminer237 avatar Oct 01 '23 19:10 mminer237