Fish shell 已正确安装: 在终端可执行“fish”命令。 确保 fish_config 是可用的: 如果fish_config命令不存在, 安装 fish-shell-common 包。 确保有使用 fish_config 的权限。
Web config started at file://tmp/web_configzm7nmfw8.html
Hit ENTER to stop.
Traceback (most recent call last):
File "/usr/share/fish/tools/web_config/webconfig.py", line 1502, in
subprocess.call(["cmd.exe", "/c", "start %s" % url])
File "/usr/lib/python3.8/subprocess.py", line 340, in call
with Popen(*popenargs, **kwargs) as p:
File "/usr/lib/python3.8/subprocess.py", line 858, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.8/subprocess.py", line 1704, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'cmd.exe'
优点:fish搭配starship效果还是不错的,可以自定义颜色,也有模板可以选;
相对于bash,fish有“命令记忆”
缺点:部分工具指定shell,得手动切换(目前遇到指定/bin/bash的得手动切)
给个权限先
chmod 755 /usr/share/fish/tools/web_config/webconfig.py
sudo vim /usr/share/fish/tools/web_config/webconfig.py
大概1488行
:1488
将
fileurl = "file://" + f.name
改为
fileurl = "file://wsl%24/ubuntu-20.04" + f.name
我的版本是这个
再运行 fish_config
参考了:
https://blog.csdn.net/qq_37151416/article/details/115772219
如果你和我一样在事先把ubuntu用wsl命令打包转移到了E盘,改路径我是不会。
可以解决掉报错里的"cmd.exe"
这里可以在wsl ubuntu中安装 Windows 命令行工具
sudo apt update
sudo apt install -y cmdtest
也可以用xdg-open
替换它
sudo vim /usr/share/fish/tools/web_config/webconfig.py
1500行左右
:1500
将
subprocess.call(["cmd.exe", "/c", "star t %s" % url])
改为
subprocess.call(["xdg-open", url])
安装工具
sudo apt-get install xdg-utils
这里生成了一个临时配置文件,/tmp/web_configat5r24k4.html
,权限为600。
我是开启了apache2服务,通过软链接ln -s /tmp/web_configat5r24k4.html fishconf
到可网页访问的目录,给权限,浏览器访问。