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")
This commit is contained in:
Tim Culverhouse
2023-09-28 09:49:37 -05:00
parent c540d18095
commit d0c673cdfc

View File

@ -4,14 +4,20 @@ const Source = @import("Source.zig");
/// Ghostty's terminfo entry. /// Ghostty's terminfo entry.
pub const ghostty: Source = .{ pub const ghostty: Source = .{
.names = &.{ .names = &.{
// The preferred name
"ghostty",
// We support the "xterm-" prefix because some poorly behaved programs // We support the "xterm-" prefix because some poorly behaved programs
// use this to detect if the terminal supports 256 colors and other // use this to detect if the terminal supports 256 colors and other
// features. // 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", "xterm-ghostty",
// The preferred name
"ghostty",
// Our "formal" name // Our "formal" name
"Ghostty", "Ghostty",
}, },