feat: Add user-friendly warning for terminal type fallback

This commit is contained in:
n loewen (aider) 2025-06-08 16:30:09 +01:00
parent 2192cf4207
commit 0f70502afc
1 changed files with 6 additions and 1 deletions

7
gtm
View File

@ -1586,7 +1586,12 @@ def main(stdscr, filename, show_add, show_del, mouse=True, no_diff=False, wrap_l
if __name__ == "__main__":
# Set a fallback terminal type if the current one isn't recognized
if os.environ.get("TERM") in ["xterm-ghostty", "unknown"]:
original_term = os.environ.get("TERM")
if original_term in ["xterm-ghostty", "unknown"]:
print(f"Warning: Terminal type '{original_term}' not recognized by curses.")
print("Falling back to 'xterm-256color' for compatibility.")
print("Press Enter to continue...")
input() # Wait for user to acknowledge before continuing
os.environ["TERM"] = "xterm-256color"
parser = argparse.ArgumentParser(description="A \"Git Time Machine\" for viewing file history")