三行で
-
VScodeでもPSReadlineが正常に動くようになりました
-
だけど、コマンド履歴検索はVScodeの他のキーバインドと競合しているため正常に動作しません
3.なんとかするには
keybindings.json
に設定を書き込めば良いらしい
設定はこちら
この設定を作成、もしくは追加します。stackoverflowに感謝
keybindings.json
// 既定値を上書きするには、このファイル内にキー バインドを挿入しますauto[]
[
{
"key": "ctrl+r",
"command": "workbench.action.terminal.sendSequence",
"when": "terminalFocus",
"args": { "text": "\u0012" }
}
]
これでコマンド履歴を検索出来ます
動作環境
❯ $PSVersionTable
Name Value
---- -----
PSVersion 7.1.0-preview.3
PSEdition Core
GitCommitId 7.1.0-preview.3
OS Microsoft Windows 10.0.19041
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
❯ Get-Module psreadline
ModuleType Version PreRelease Name ExportedCommands
---------- ------- ---------- ---- ----------------
Script 2.1.0 beta2 PSReadLine
Visual Studio Code 1.46.1
ms-vscode.powershell-preview