fix: Add fallback terminal type for xterm-ghostty to resolve curses initialization error

This commit is contained in:
n loewen (aider) 2025-06-08 16:25:10 +01:00
parent 31d6e0ef55
commit 2192cf4207
1 changed files with 4 additions and 0 deletions

4
gtm
View File

@ -1585,6 +1585,10 @@ def main(stdscr, filename, show_add, show_del, mouse=True, no_diff=False, wrap_l
pass pass
if __name__ == "__main__": 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 = 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-diff", action="store_true", help="Don't highlight added and deleted lines")
parser.add_argument("--no-mouse", action="store_true", help="Disable mouse support") parser.add_argument("--no-mouse", action="store_true", help="Disable mouse support")