更新 main.py,优化 PyShell 目录判断逻辑并简化终端窗口标题设置
This commit is contained in:
4
main.py
4
main.py
@@ -34,7 +34,7 @@ def pseudo_zsh():
|
||||
else:
|
||||
CmdDir = dir.split('/')[-1]
|
||||
|
||||
if CmdDir == 'PyShell' :
|
||||
if dir.split('/')[-1] == 'PyShell' :
|
||||
CmdDir == '~/'
|
||||
|
||||
# 显示提示符并获取用户输入
|
||||
@@ -82,7 +82,7 @@ def pseudo_zsh():
|
||||
print(f"zsh: command not found: {args[0]}")
|
||||
|
||||
# 修改终端窗口标题
|
||||
sys.stdout.write(f"\033]0;{CmdDir}-zsh\007") # 使用 ANSI 转义序列设置标题
|
||||
sys.stdout.write(f"\033]0;zsh\007") # 使用 ANSI 转义序列设置标题
|
||||
sys.stdout.flush()
|
||||
except KeyboardInterrupt:
|
||||
print(f"^C")
|
||||
|
||||
Reference in New Issue
Block a user