1
1
mirror of https://github.com/walles/moar.git synced 2024-10-03 23:17:51 +03:00

Mouse copying in VSCode and IntelliJ

Selecting text now works by default with these terminals.
This commit is contained in:
Johan Walles 2024-05-06 06:48:59 +02:00
parent 52cf51f35e
commit f1e886624e
2 changed files with 11 additions and 1 deletions

View File

@ -8,7 +8,7 @@ Most terminals support this capability, see [Selection workarounds for `scroll`
- `select` makes `moar` not process mouse events. This makes selecting and copying text work, but scrolling might not be possible, depending on your terminal and its configuration.
- `auto` uses `select` on terminals where we know it won't break scrolling, and
`scroll` on all others. [The white list lives in the
`mouseTrackingRecommended()` function in
`terminalHasArrowKeysEmulation()` function in
`screen.go`](https://github.com/walles/moar/blob/master/twin/screen.go).
The reason these tradeoffs exist is that if `moar` requests mouse events from the terminal,

View File

@ -291,6 +291,16 @@ func terminalHasArrowKeysEmulation() bool {
return true
}
// VSCode 1.89.0, tested on macOS 14.4, May 6th, 2024
if os.Getenv("TERM_PROGRAM") == "vscode" {
return true
}
// IntelliJ IDEA CE 2023.2.2, tested on macOS 14.4, May 6th, 2024
if os.Getenv("TERM_PROGRAM") == "JetBrains-JediTerm" {
return true
}
return false
}