hack のためのネタ帳, etc,,,

自力で From Here

以下の公式資料 によると
オプション -p でプロファイル
オプション -d でターゲットのディレクトリ
を設定できるらしい。

従って
wt -d . -p Ubuntu
みたいにすると、カレントディレクトリで Ubuntu を開くことが出来る。
Cygwin からだと
cygstart wt -d . -p Ubuntu

Context Menu への追加はこうかな?
cmd.exe からだと、
REG ADD HKCR\Folder\Shell\WSLUbuntuHere         /f /ve /d "WSL Ubuntu here"
REG ADD HKCR\Folder\Shell\WSLUbuntuHere\command /f /ve /t REG_EXPAND_SZ /d """"%^LOCALAPPDATA%\Microsoft\WindowsApps\wt.exe""" -d """%L""" -p Ubuntu"
REG ADD HKCR\Directory\Background\Shell\WSLUbuntuHere /f /ve /d "WSL Ubuntu here"
REG ADD HKCR\Directory\Background\Shell\WSLUbuntuHere\command /f /ve /t REG_EXPAND_SZ /d """"%^LOCALAPPDATA%\Microsoft\WindowsApps\wt.exe""" -d """%V""" -p Ubuntu"
PowerShell からだと、
REG ADD HKCR\Folder\Shell\WSLUbuntuHere         /f /ve /d "WSL Ubuntu here"
REG ADD HKCR\Folder\Shell\WSLUbuntuHere\command /f /ve /t REG_EXPAND_SZ /d '"""%LOCALAPPDATA%\Microsoft\WindowsApps\wt.exe""" -d """%L""" -p Ubuntu'
REG ADD HKCR\Directory\Background\Shell\WSLUbuntuHere /f /ve /d "WSL Ubuntu here"
REG ADD HKCR\Directory\Background\Shell\WSLUbuntuHere\command /f /ve /t REG_EXPAND_SZ /d '"""%LOCALAPPDATA%\Microsoft\WindowsApps\wt.exe""" -d """%V""" -p Ubuntu'
消すときは以下のように
REG DELETE HKCR\Folder\Shell\WSLUbuntuHere /f
REG DELETE HKCR\Directory\Background\Shell\WSLUbuntuHere /f

From Here するその他の方法

"windows terminal" "from here"」でググると以下 issue が見つかる
この中で以下の repos が紹介されてて、
Install/uninstall scripts for Windows Terminal context menu items これは context menu に from here 追加する PowerShell Script が提供されてる

また、2日前に以下の pr が commit されてるので、近々標準で from here 搭載になるっぽい。

コメントをかく


「http://」を含む投稿は禁止されています。

利用規約をご確認のうえご記入下さい

Wiki内検索

フリーエリア

管理人/副管理人のみ編集できます