mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 13:25:51 +03:00
[GH-ISSUE #1027] Can not select texts with EnableMouse(true) #743
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#743
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @rush1kesh-010 on GitHub (Sep 25, 2024).
Original GitHub issue: https://github.com/rivo/tview/issues/1027
When we have
Application.EnableMouse(true), we can not select any text with mouse drag in the terminal.Is it possible to use mouse events while allowing selection of texts with mouse drag?
Here's what I mean by selecting text using mouse drag:

@rivo commented on GitHub (Sep 25, 2024):
It works for me in iTerm2 on macOS. Could it be that you need to enable it in your terminal software?
If your terminal software doesn't support selections while forwarding mouse events to the app running inside, there is not much
tviewcan do about it. For example,TextAreaandInputFielddo support text selections but it all happens inside the app. If you want to copy+paste this "emulated" selection like you're used to in non-mouse mode, it's not going to work because your terminal won't have any information about that selection. Unless, of course, your app has access to your local clipboard (which is possible but not very common because it's highly OS-dependent). I don't think this is something you intend to implement.By the way, if your terminal supports it, you can add hyperlinks to the text, see here. Your screenshot seemed like you might want to make those URLs clickable.
@rush1kesh-010 commented on GitHub (Sep 26, 2024):
Yes, holding shift bypasses the mouse event forwarding in GNOME terminal in ubuntu, and I can select text using this method.
But for Windows cmd and powershell, there is no bypassing supported for mouse event forwarding. I need to open the Window Control Menu and click
Edit->Markto enter text selection mode in Windows terminals.Is it possible to make the gnome terminal by default select text like MacOS?