在 WSL 中启动 Fish_config Web ui 时出错

nee*_*229 1 ubuntu fish windows-subsystem-for-linux

我想fish使用Web UI模式自定义我的shell,但是在运行时fish_config colors,显示以下错误。

surface@Surface ~> fish_config starting-colors
Web config started at file:///tmp/web_configoafehdco.html
Hit ENTER to stop.
Start : This command cannot be run due to the error: The system cannot find the file specified.
At line:1 char:1
+ Start "file:///tmp/web_configoafehdco.html"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Start-Process], InvalidOperationException
    + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommandd                                                                                                                                                                                                                                                                            
Run Code Online (Sandbox Code Playgroud)

我在 Linux 的 Windows 子系统中运行 Ubuntu

nee*_*229 5

在浏览了一些文章但没有找到正确答案后,我发现运行时'help' 它会打开浏览器并指向

file://wsl%24/Ubuntu-20.04/usr/share/doc/fish/index.html#variables-for-changing-highlighting-colors
Run Code Online (Sandbox Code Playgroud)

当我们尝试运行fish_config时,它指向

"file://wsl%24/Ubuntu/tmp/web_configpo_b9wan.html"
Run Code Online (Sandbox Code Playgroud)

这意味着,我们需要将 wsl%24/Ubuntu 更改为 wsl%24/Ubuntu-20.04。

为此,首先打开 webconfig 目录。

cd /usr/share/fish/tools/web_config
Run Code Online (Sandbox Code Playgroud)

现在,授予 webconfig.py 文件写入权限。

sudo chmod 777 webconfig.py
Run Code Online (Sandbox Code Playgroud)

在 webconfig.py 文件中"file:///" + f.name"修改以下行:"file://wsl%24/Ubuntu-20.04" + f.name


通过运行将文件的权限更改回其原始状态chmod 644 webconfig.py

你可以走了。