dustinblackman/oatmeal

Do not prevent copying text with mouse pointer selection

Opened this issue ยท 3 comments

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 ๐Ÿ‘

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.

@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 ๐Ÿค”

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?