我正在使用新的windows terminal。
我只是安装了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在path中):
> 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所在的路径。
我还尝试在$EDITOR中设置visual studio code的完整路径,但没有帮助。
发布于 2020-08-23 04:13:46
我遇到了完全相同的问题,并设法通过将$EDITOR变量设置为编辑器的绝对路径来解决它,因此对于Visual Studio Code,将以下内容添加到您的$PROFILE中:
$ENV:EDITOR = "C:\Program Files\Microsoft VS Code\Code.exe"发布于 2020-07-12 06:35:56
你的意思是,打开ps1的默认程序?如果是,则是注册表项、HKLM和find extension...
发布于 2020-07-12 07:06:54
我很惊讶代码没有出现在你的路径中:
$env:path += ";C:\Users\$username\AppData\Local\Programs\Microsoft VS Code\bin"https://stackoverflow.com/questions/62848261
复制相似问题