Skip to content
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

Do not prevent copying text with mouse pointer selection #41

Open
andrewbrey opened this issue Jan 25, 2024 · 3 comments
Open

Do not prevent copying text with mouse pointer selection #41

andrewbrey opened this issue Jan 25, 2024 · 3 comments

Comments

@andrewbrey
Copy link

Thank you for the very cool project!

I noticed that when setting up crossterm mouse input is captured:

crossterm::execute!(
stdout,
EnterAlternateScreen,
EnableMouseCapture,
EnableBracketedPaste
)?;

and I think that one result of this is that attempting to highlight (and thus copy in many terminals) a portion of the output with a mouse pointer is not possible. The /copy slash command is helpful for codeblocks, but it's not currently possible to copy out non-codeblock text as far as I can tell.

I'm not sure if this is as simple as simply not capturing the mouse input, but I would personally find it helpful if I was able to select text printed by the TUI and have my terminal's normal behavior of copying the selected/highlighted text still occur 👍

@dustinblackman
Copy link
Owner

Hey there! Sorry for the delay.

You're not wrong. I think when I had first started I had needed EnableMouseCapture, but I don't anymore. The only issue is that when highlighting, it also takes the borders of the chat bubble along with it. Example:

│ ``` (1)                                                                                                                                                                                                                          │          █
│ public class PrintNumbers {                                                                                                                                                                                                      │          █
│     public static void main(String[] args) {                                                                                                                                                                                     │          █
│         System.out.println("Hello World!");                                                                                                                                                                                      │          █
│     }                                                                                                                                                                                                                            │          █
│ }                                                                                                                                                                                                                                │          █
│ ```  

So I could disable it for sure, but I'm not sure how to handle the border problem.

@andrewbrey
Copy link
Author

@dustinblackman what if you didn't use actual characters to create the chat bubble, but instead just set a background color to symbolize the chat bubble - then there would be no characters included in the highlight 🤔

@0xhaggis
Copy link

This is driving me crazy, too. It's this and one other issue (insertion of line breaks aka word wrapping) that keeps me from using Oatmeal 100% of the time compared to LM Studio.

I don't even care about copying the borders along with text, I'd live with it! Often I just want to copy a small snippet and wouldn't even touch the borders.

If I fork the Oatmeal project, is it as simple as removing EnableMouseCapture, from crossterm::execute!(...) to enable the mouse?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants