DeepLcom / deepl-tui

Terminal user interface for the DeepL language translation API.
MIT License
13 stars 0 forks source link

Can't copy translation #3

Open komape opened 2 months ago

komape commented 2 months ago

It's impossible to copy the translation. In the input field, I can select the text and copy it. I can also paste text into the input field. However, the output is unreachable.

This is very annoying if I translate longer texts and don't want to type the translation by hand.

cluttrdev commented 2 months ago

Thanks for the feedback. I added support for this in v0.3.0.

Can you try and see if this works for you?

komape commented 2 months ago

Can you try and see if this works for you?

Can't try it. See #4 for the reason.

komape commented 2 months ago
  • opy: Ctrl + C (both input and output)

  • Cut: Ctrl + X (only input)

  • Paste: Ctrl + V (only input)

On Mac, you normally use the Cmd key instead of the Ctrl key for these actions. Can you configure deepl-tui to use those keys?

cluttrdev commented 2 months ago

I'm aware of that, but the framework I'm using to create this terminal UI does not natively support this.

From its docs:

Note that using your terminal's / operating system's key bindings for copy+paste functionality may not have the expected effect as tview will not be able to handle these keys. Pasting text using your operating system's or terminal's own methods may be very slow as each character will be pasted individually.

and

The default clipboard is an internal text buffer local to this text area instance, i.e. the operating system's clipboard is not used.

I had to override the default clipboard functionality to be able to use the system's clipboard in the first place. I might also be able to replicate the Cmd + C/V/X shortcuts behavior (not making any promises though). Until then, do Ctrl + C/V/X key bindings work as you'd expect them to?

komape commented 2 months ago

With Ctrl the keybindings are working 👍