我正在使用新的windows 终端。
我刚刚安装了powershell v7.0.2和starship以使其更好。
我想编辑starship配置,所以我运行了这个命令:
> starship.exe config
----------------------
Error: editor "vi" was not found. Did you set your $EDITOR or $VISUAL environment variables correctly?
Full error: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }
所以我继续编辑我$PROFILE的设置visual studio code为默认编辑器(code在路径中):
> code $PROFILE
---------------
$ENV:EDITOR = "code"
$ENV:VISUAL = "code"
现在我得到了同样的错误,但是用code而不是vi:
> starship.exe config
----------------------
Error: editor "code" was not found. Did you set your $EDITOR or $VISUAL environment variables correctly?
Full error: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }
我最终运行的原因starship config是因为在创建$HOME\.starship\starship.toml配置文件后starship忽略它,尽管我已经在我的配置文件中设置了路径:
> code $PROFILE
---------------
$ENV:STARSHIP_CONFIG = "$HOME\.starship"
所以我跑去starhip config看看它期望的路径是什么config file。
我也尝试将完整路径设置为visual studio codein $EDITOR,但没有帮助。