From 523c4268b5fc034afe70b3b0a6368f778a4bef4b Mon Sep 17 00:00:00 2001 From: Johan Walles Date: Sun, 12 Jan 2025 15:38:20 +0100 Subject: [PATCH] Ghostty does arrow key emulation out of the box --- twin/screen.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/twin/screen.go b/twin/screen.go index 969ab13..1b9c415 100644 --- a/twin/screen.go +++ b/twin/screen.go @@ -345,6 +345,12 @@ func terminalHasArrowKeysEmulation() bool { return true } + // Ghostty 1.0.1, tested on macOS 15.1.1, Jan 12th, 2025 + if os.Getenv("TERM_PROGRAM") == "ghostty" { + log.Info("Ghostty terminal detected, assuming arrow keys emulation active") + return true + } + log.Info("No known terminal with arrow keys emulation detected, assuming mouse tracking is needed") return false }