feat: Add user-friendly warning for terminal type fallback
This commit is contained in:
parent
2192cf4207
commit
0f70502afc
7
gtm
7
gtm
|
|
@ -1586,7 +1586,12 @@ def main(stdscr, filename, show_add, show_del, mouse=True, no_diff=False, wrap_l
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
# Set a fallback terminal type if the current one isn't recognized
|
# 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"
|
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")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue