From 2192cf420770c0ef5db8e307fb745ed62f296f0f Mon Sep 17 00:00:00 2001 From: "n loewen (aider)" Date: Sun, 8 Jun 2025 16:25:10 +0100 Subject: [PATCH] fix: Add fallback terminal type for xterm-ghostty to resolve curses initialization error --- gtm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gtm b/gtm index 5ef5b36..2d1220e 100755 --- a/gtm +++ b/gtm @@ -1585,6 +1585,10 @@ def main(stdscr, filename, show_add, show_del, mouse=True, no_diff=False, wrap_l pass if __name__ == "__main__": + # Set a fallback terminal type if the current one isn't recognized + if os.environ.get("TERM") in ["xterm-ghostty", "unknown"]: + os.environ["TERM"] = "xterm-256color" + parser = argparse.ArgumentParser(description="A \"Git Time Machine\" for viewing file history") parser.add_argument("--no-diff", action="store_true", help="Don't highlight added and deleted lines") parser.add_argument("--no-mouse", action="store_true", help="Disable mouse support")