diff --git a/main.py b/main.py index 7e2dc5d..aee3259 100644 --- a/main.py +++ b/main.py @@ -17,9 +17,7 @@ def pseudo_zsh(): readline.parse_and_bind("tab: complete") readline.set_completer(completer) - # 修改终端窗口标题 - sys.stdout.write("\033]0;zsh\007") # 使用 ANSI 转义序列设置标题 - sys.stdout.flush() + os.system("clear && cd ~") # 清屏 print(f"Last login: {datetime.now().strftime('%a %b %d %H:%M:%S %Y')} on ttys000") @@ -82,6 +80,10 @@ def pseudo_zsh(): subprocess.run(args) except FileNotFoundError: print(f"zsh: command not found: {args[0]}") + + # 修改终端窗口标题 + sys.stdout.write(f"\033]0;{CmdDir}-zsh\007") # 使用 ANSI 转义序列设置标题 + sys.stdout.flush() except KeyboardInterrupt: print(f"^C") except EOFError: