From d0c673cdfc7ff23b621bf56922f5c50d4991f2b0 Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Thu, 28 Sep 2023 09:49:37 -0500 Subject: [PATCH] terminfo: use 'xterm-ghostty' as primary name Use "xterm-ghostty" as the primary terminfo name. This is a hack on a hack...we use "xterm-ghostty" to prevent vim from breaking, and when we do this as the default we break tcell-based applications (lazygit, aerc, etc). tcell has a bug where the primary terminfo name must be the value of TERM. https://github.com/gdamore/tcell/pull/639 fixes the issue but is not merged yet. Fixes: 779186ad ("config: add term config option") --- src/terminfo/ghostty.zig | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/terminfo/ghostty.zig b/src/terminfo/ghostty.zig index 314870d1f..ff187ad3c 100644 --- a/src/terminfo/ghostty.zig +++ b/src/terminfo/ghostty.zig @@ -4,14 +4,20 @@ const Source = @import("Source.zig"); /// Ghostty's terminfo entry. pub const ghostty: Source = .{ .names = &.{ - // The preferred name - "ghostty", - // We support the "xterm-" prefix because some poorly behaved programs // use this to detect if the terminal supports 256 colors and other // features. + // HACK: This is a hack on a hack...we use "xterm-ghostty" to prevent + // vim from breaking, and when we do this as the default we break + // tcell-based applications (lazygit, aerc, etc). tcell has a bug where + // the primary terminfo name must be the value of TERM. + // https://github.com/gdamore/tcell/pull/639 fixes the issue but is not + // merged yet. Consider switching these in the future. "xterm-ghostty", + // The preferred name + "ghostty", + // Our "formal" name "Ghostty", },