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
Make the rendered text on the terminal copyable #985
Comments
Can you provide some more details please (OS, terminal, backend, example code or a link to your code). Also, given all of the above, there's lots of different ways to interpret "copying" (programmatic, mouse, cursor selection, automatic highlight vs ctrl/cmd+C etc). Can you be more specific? |
Sorry, I posted the wrong link, I have corrected it. it is this link https://github.com/altsem/gitu/tree/master/src/screen |
I still need more info on what the problem is here |
I am not the OP, but I'd also like to learn more about what is possible when it comes to copying. When using Debian's default Gnome Terminal (Version 3.51.90 for GNOME 46), putting selected text into clipboard is not automatic, but the user still can select the text, then put it into clipboard with CTRL+SHIFT+C (or selecting 'Copy' from the context menu after clicking right mouse button). I am also not able to select the text in ratatui apps and neither bring up context menu with right mouse button. I understand it is not trivial to make it possible for every terminal emulator and OS, but I suppose copying text is very important "feature" that shouldn't be lost with Ratatui. EDIT: |
At least gnome console and alacritty support Shift + Click when the terminal is in alt mode. Then Ctrl + Shift + C can be used to copy the content into the system clipboard. |
Table has mouse capture turned on (as do a lot of the examples unnecessarily). This prevents the mouse clicks that would generally make it possible to perform copy/paste actions (noting that there's usually workarounds as @EdJoPaTo mentions). Line 185 in 326a461
Fixing this means:
@chgxtony would it be safe to reframe this issue as "Many of the examples don't allow selecting text using the mouse"? |
This is not specific to only the examples. Also with scrollable widgets and mouse interaction mouse capture is of interest. |
Got it - perhaps it would be worth adding some info about this sort of problem in the website somewhere. Maybe a FAQ about how mouse capture interacts with selection. |
Problem
The text rendered to the screen by Ratatui cannot be copied now
Solution
https://github.com/altsem/gitu/tree/master/src/screen
this project still references
Ratatui
, which enables text to be copied。Can these functions be integrated into Ratatui's widgets
The text was updated successfully, but these errors were encountered: