
fish
Web UIモードを使用してシェルをカスタマイズしたいのですが、実行時に次の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
Linux用のWindowsサブシステムでUbuntuを実行しています。
答え1
いくつかの記事を見てきましたが、正しい答えが見つからなかった後に実行すると、'help'
ブラウザが開き、次を指すことがわかりました。
file://wsl%24/Ubuntu-20.04/usr/share/doc/fish/index.html#variables-for-changing-highlighting-colors
私たちが走ろうとしているとき魚の構成、これは以下を指す。
"file://wsl%24/Ubuntu/tmp/web_configpo_b9wan.html"
つまり、wsl%24/Ubuntu を wsl%24/Ubuntu-20.04 に変更する必要があります。
これを行うには、まずwebconfigディレクトリを開きます。
cd /usr/share/fish/tools/web_config
次に、webconfig.py ファイルに書き込み権限を付与します。
sudo chmod 777 webconfig.py
webconfig.pyファイルで"file:///" + f.name"
次の行を変更します。"file://wsl%24/Ubuntu-20.04" + f.name
次を実行して、ファイルの権限を元の状態に戻します。chmod 644 webconfig.py
今行ってもいいです。
答え2
この問題は、WSL2ディストリビューションに最新バージョンがないために発生するようですfish
。回避策は、wsl
WSL2検出を修正することです。fish
/usr/share/fish/tools/web_config/webconfig.py
あなたのものを編集し、/usr/share/fish/tools/web_config/webconfig.py
機能をis_wsl()
次のように変更します。
def is_wsl():
""" Return whether we are running under the Windows Subsystem for Linux """
if "linux" in platform.system().lower() and os.access("/proc/version", os.R_OK):
with open("/proc/version", "r") as f:
# Find 'Microsoft' for wsl1 and 'microsoft' for wsl2
if "microsoft" in f.read().lower():
return True
return False
特に、「マイクロソフト」を「マイクロソフト」に変更してください。 (大文字から小文字「m」)
もっと情報が欲しいなら読んでくださいこの問題Fish Shellのgithubリポジトリで開きます。