-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto configure mouse settings in more terminals
Tested all the Linux ones in Virtualbox. Yay Virtualbox!
- Loading branch information
Showing
3 changed files
with
32 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -204,15 +204,11 @@ func (screen *UnixScreen) hideCursor(hide bool) { | |
// See also: https://github.com/walles/moar/issues/53 | ||
func terminalHasArrowKeysEmulation() bool { | ||
// Untested: | ||
// * https://codeberg.org/dnkl/foot | ||
// * Konsole | ||
// * https://github.com/gnome-terminator/terminator | ||
// * https://gnunn1.github.io/tilix-web/ | ||
// * The Windows terminal | ||
|
||
// Better off with mouse tracking: | ||
// * iTerm2 | ||
// * Terminal.app | ||
// * iTerm2 (macOS) | ||
// * Terminal.app (macOS) | ||
|
||
// Hyper, tested on macOS, December 14th 2023 | ||
if os.Getenv("TERM_PROGRAM") == "Hyper" { | ||
|
@@ -234,6 +230,33 @@ func terminalHasArrowKeysEmulation() bool { | |
return true | ||
} | ||
|
||
// GNOME Terminal, tested on Ubuntu 22.04, December 16th 2023 | ||
if os.Getenv("GNOME_TERMINAL_SCREEN") != "" { | ||
return true | ||
} | ||
|
||
// Tilix, tested on Ubuntu 22.04, December 16th 2023 | ||
if os.Getenv("TILIX_ID") != "" { | ||
return true | ||
} | ||
|
||
// Konsole, tested on Ubuntu 22.04, December 16th 2023 | ||
if os.Getenv("KONSOLE_VERSION") != "" { | ||
return true | ||
} | ||
|
||
// Terminator, tested on Ubuntu 22.04, December 16th 2023 | ||
if os.Getenv("TERMINATOR_UUID") != "" { | ||
return true | ||
} | ||
|
||
// Foot, tested on Ubuntu 22.04, December 16th 2023 | ||
if os.Getenv("TERM") == "foot" { | ||
// Note that this test isn't very good, somebody could be running Foot | ||
// with some other TERM setting. Other suggestions welcome. | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
walles
Author
Owner
|
||
return true | ||
} | ||
|
||
return false | ||
} | ||
|
||
|
@walles
foot-extra
is common, I myself use this. Alsofoot-direct
andfoot-extra-direct
. Reference: https://codeberg.org/dnkl/foot/wiki#user-content-foot-s-terminfo-vs-ncurses-terminfo. I don't think there are any environment vars to query.