终端中的 cd 命令执行时间太长

Nis*_*mar 8 gnome-terminal cd-command

当我尝试使用 cd 命令导航目录时,需要很长时间。终端建议创建一个配置文件来增加超时时间。一旦我的终端挂起,我的意思是当我尝试执行命令时,光标不断闪烁,但没有任何反应,甚至 ctrl+c 也没有效果,我不得不重新启动。但缓慢的终端仍然存在。我发现这个延迟问题仅发生在 cd 命令中。

\n
~ on \xe2\x98\x81\xef\xb8\x8f  (us-east-2) \n\xe2\x9d\xaf cd Cloud/\n[WARN] - (starship::utils): Executing command "/usr/bin/git" timed out.\n[WARN] - (starship::utils): You can set command_timeout in your config to a higher value to allow longer-running commands to keep executing.\n\nCloud on \xee\x82\xa0 main on \xe2\x98\x81\xef\xb8\x8f  (us-east-2) \n\xe2\x9d\xaf \n
Run Code Online (Sandbox Code Playgroud)\n

小智 6

消息很明确,您只需要设置超时

在内部~/.config/starship.toml(如果不存在则创建它)您可以像这样设置超时:

command_timeout = 10000
Run Code Online (Sandbox Code Playgroud)

然后更新或重新安装星舰:

sh -c "$(curl -fsSL https://starship.rs/install.sh)"
Run Code Online (Sandbox Code Playgroud)