Open mawosoft opened 1 year ago
Keymap conflicts between defaults for PSReadLine and VSCode:
[
{
"FirstNormalized": "Alt+D0",
"PSReadLine": {
"Key": "Alt+0",
"Function": "DigitArgument",
"Description": "Start or accumulate a numeric argument to other functions",
"Group": 5
},
"VSCode": {
"key": "alt+0",
"command": "workbench.action.lastEditorInGroup",
"skipShell": true
}
},
{
"FirstNormalized": "Alt+D1",
"PSReadLine": {
"Key": "Alt+1",
"Function": "DigitArgument",
"Description": "Start or accumulate a numeric argument to other functions",
"Group": 5
},
"VSCode": {
"key": "alt+1",
"command": "workbench.action.openEditorAtIndex1"
}
},
{
"FirstNormalized": "Alt+D2",
"PSReadLine": {
"Key": "Alt+2",
"Function": "DigitArgument",
"Description": "Start or accumulate a numeric argument to other functions",
"Group": 5
},
"VSCode": {
"key": "alt+2",
"command": "workbench.action.openEditorAtIndex2"
}
},
{
"FirstNormalized": "Alt+D3",
"PSReadLine": {
"Key": "Alt+3",
"Function": "DigitArgument",
"Description": "Start or accumulate a numeric argument to other functions",
"Group": 5
},
"VSCode": {
"key": "alt+3",
"command": "workbench.action.openEditorAtIndex3"
}
},
{
"FirstNormalized": "Alt+D4",
"PSReadLine": {
"Key": "Alt+4",
"Function": "DigitArgument",
"Description": "Start or accumulate a numeric argument to other functions",
"Group": 5
},
"VSCode": {
"key": "alt+4",
"command": "workbench.action.openEditorAtIndex4"
}
},
{
"FirstNormalized": "Alt+D5",
"PSReadLine": {
"Key": "Alt+5",
"Function": "DigitArgument",
"Description": "Start or accumulate a numeric argument to other functions",
"Group": 5
},
"VSCode": {
"key": "alt+5",
"command": "workbench.action.openEditorAtIndex5"
}
},
{
"FirstNormalized": "Alt+D6",
"PSReadLine": {
"Key": "Alt+6",
"Function": "DigitArgument",
"Description": "Start or accumulate a numeric argument to other functions",
"Group": 5
},
"VSCode": {
"key": "alt+6",
"command": "workbench.action.openEditorAtIndex6"
}
},
{
"FirstNormalized": "Alt+D7",
"PSReadLine": {
"Key": "Alt+7",
"Function": "DigitArgument",
"Description": "Start or accumulate a numeric argument to other functions",
"Group": 5
},
"VSCode": {
"key": "alt+7",
"command": "workbench.action.openEditorAtIndex7"
}
},
{
"FirstNormalized": "Alt+D8",
"PSReadLine": {
"Key": "Alt+8",
"Function": "DigitArgument",
"Description": "Start or accumulate a numeric argument to other functions",
"Group": 5
},
"VSCode": {
"key": "alt+8",
"command": "workbench.action.openEditorAtIndex8"
}
},
{
"FirstNormalized": "Alt+D9",
"PSReadLine": {
"Key": "Alt+9",
"Function": "DigitArgument",
"Description": "Start or accumulate a numeric argument to other functions",
"Group": 5
},
"VSCode": {
"key": "alt+9",
"command": "workbench.action.openEditorAtIndex9"
}
},
{
"FirstNormalized": "Ctrl+a",
"PSReadLine": {
"Key": "Ctrl+a",
"Function": "SelectAll",
"Description": "Select the entire line. Moves the cursor to the end of the line",
"Group": 6
},
"VSCode": {
"key": "ctrl+a",
"command": "editor.action.selectAll"
}
},
{
"FirstNormalized": "Ctrl+Backspace",
"PSReadLine": {
"Key": "Ctrl+Backspace",
"Function": "BackwardKillWord",
"Description": "Move the text from the start of the current or previous word to the cursor to the kill ring",
"Group": 0
},
"VSCode": [
{
"key": "ctrl+backspace",
"command": "workbench.action.terminal.sendSequence",
"when": "terminalFocus",
"args": {
"text": "\u0017"
},
"skipShell": true
},
{
"key": "ctrl+backspace",
"command": "workbench.action.terminal.sendSequence",
"when": "terminalFocus && terminalShellType == 'cmd'",
"args": {
"text": "\b"
},
"skipShell": true
}
]
},
{
"FirstNormalized": "Ctrl+c",
"PSReadLine": {
"Key": "Ctrl+c",
"Function": "CopyOrCancelLine",
"Description": "Either copy selected text to the clipboard, or if no text is selected, cancel editing the line with CancelLine.",
"Group": 0
},
"VSCode": [
{
"key": "ctrl+c",
"command": "editor.action.clipboardCopyAction"
},
{
"key": "ctrl+c",
"command": "workbench.action.terminal.copyAndClearSelection",
"when": "terminalTextSelectedInFocused || terminalFocus && terminalHasBeenCreated && terminalTextSelected || terminalFocus && terminalProcessSupported && terminalTextSelected || terminalFocus && terminalTextSelected && terminalTextSelectedInFocused || terminalHasBeenCreated && terminalTextSelected && terminalTextSelectedInFocused || terminalProcessSupported && terminalTextSelected && terminalTextSelectedInFocused",
"skipShell": true
}
]
},
{
"FirstNormalized": "Ctrl+Delete",
"PSReadLine": {
"Key": "Ctrl+Delete",
"Function": "KillWord",
"Description": "Move the text from the cursor to the end of the current or next word to the kill ring",
"Group": 0
},
"VSCode": {
"key": "ctrl+delete",
"command": "workbench.action.terminal.sendSequence",
"when": "terminalFocus",
"args": {
"text": "\u001bd"
},
"skipShell": true
}
},
{
"FirstNormalized": "Ctrl+End",
"PSReadLine": {
"Key": "Ctrl+End",
"Function": "ForwardDeleteInput",
"Description": "Delete text from the cursor to the end of the input",
"Group": 0
},
"VSCode": {
"key": "ctrl+end",
"command": "workbench.action.terminal.scrollToBottom",
"when": "terminalFocusInAny && terminalHasBeenCreated && !terminalAltBufferActive || terminalFocusInAny && terminalProcessSupported && !terminalAltBufferActive",
"skipShell": true
}
},
{
"FirstNormalized": "Ctrl+Home",
"PSReadLine": {
"Key": "Ctrl+Home",
"Function": "BackwardDeleteInput",
"Description": "Delete text from the cursor to the start of the input",
"Group": 0
},
"VSCode": {
"key": "ctrl+home",
"command": "workbench.action.terminal.scrollToTop",
"when": "terminalFocusInAny && terminalHasBeenCreated && !terminalAltBufferActive || terminalFocusInAny && terminalProcessSupported && !terminalAltBufferActive",
"skipShell": true
}
},
{
"FirstNormalized": "Ctrl+PageDown",
"PSReadLine": {
"Key": "Ctrl+PageDown",
"Function": "ScrollDisplayDownLine",
"Description": "Scroll the display down one line",
"Group": 5
},
"VSCode": [
{
"key": "ctrl+pagedown",
"command": "workbench.action.nextEditor",
"skipShell": true
},
{
"key": "ctrl+pagedown",
"command": "workbench.action.terminal.focusNext",
"when": "terminalFocus && terminalHasBeenCreated && !terminalEditorFocus || terminalFocus && terminalProcessSupported && !terminalEditorFocus",
"skipShell": true
}
]
},
{
"FirstNormalized": "Ctrl+PageUp",
"PSReadLine": {
"Key": "Ctrl+PageUp",
"Function": "ScrollDisplayUpLine",
"Description": "Scroll the display up one line",
"Group": 5
},
"VSCode": [
{
"key": "ctrl+pageup",
"command": "workbench.action.previousEditor",
"skipShell": true
},
{
"key": "ctrl+pageup",
"command": "workbench.action.terminal.focusPrevious",
"when": "terminalFocus && terminalHasBeenCreated && !terminalEditorFocus || terminalFocus && terminalProcessSupported && !terminalEditorFocus",
"skipShell": true
}
]
},
{
"FirstNormalized": "Ctrl+r",
"PSReadLine": {
"Key": "Ctrl+r",
"Function": "ReverseSearchHistory",
"Description": "Search history backwards interactively",
"Group": 2
},
"VSCode": [
{
"key": "ctrl+r",
"command": "workbench.action.openRecent"
},
{
"key": "ctrl+r",
"command": "workbench.action.terminal.runRecentCommand",
"when": "accessibilityModeEnabled && terminalFocus && terminalHasBeenCreated || accessibilityModeEnabled && terminalFocus && terminalProcessSupported || accessibilityModeEnabled && accessibleViewIsShown && terminalHasBeenCreated && accessibleViewCurrentProviderId == 'terminal' || accessibilityModeEnabled && accessibleViewIsShown && terminalProcessSupported && accessibleViewCurrentProviderId == 'terminal'",
"skipShell": true
}
]
},
{
"FirstNormalized": "Ctrl+s",
"PSReadLine": {
"Key": "Ctrl+s",
"Function": "ForwardSearchHistory",
"Description": "Search history forward interactively",
"Group": 2
},
"VSCode": {
"key": "ctrl+s",
"command": "workbench.action.files.save"
}
},
{
"FirstNormalized": "Ctrl+Shift+c",
"PSReadLine": {
"Key": "Ctrl+C",
"Function": "Copy",
"Description": "Copy selected region to the system clipboard. If no region is selected, copy the whole line",
"Group": 0
},
"VSCode": [
{
"key": "ctrl+shift+c",
"command": "workbench.action.terminal.copySelection",
"when": "terminalTextSelectedInFocused || terminalFocus && terminalHasBeenCreated && terminalTextSelected || terminalFocus && terminalProcessSupported && terminalTextSelected || terminalFocus && terminalTextSelected && terminalTextSelectedInFocused || terminalHasBeenCreated && terminalTextSelected && terminalTextSelectedInFocused || terminalProcessSupported && terminalTextSelected && terminalTextSelectedInFocused",
"skipShell": true
},
{
"key": "ctrl+shift+c",
"command": "workbench.action.terminal.openNativeConsole",
"when": "!terminalFocus"
}
]
},
{
"FirstNormalized": "Ctrl+Spacebar",
"PSReadLine": {
"Key": "Ctrl+Spacebar",
"Function": "MenuComplete",
"Description": "Complete the input if there is a single completion, otherwise complete the input by selecting from a menu of possible completions.",
"Group": 3
},
"VSCode": [
{
"key": "ctrl+space",
"command": "workbench.action.terminal.sendSequence",
"when": "terminalFocus && terminalShellIntegrationEnabled && !accessibilityModeEnabled && terminalShellType == 'pwsh'",
"args": {
"text": "\u001b[24~a"
},
"skipShell": true
},
{
"key": "ctrl+space",
"command": "workbench.action.terminal.sendSequence",
"when": "config.terminal.integrated.shellIntegration.suggestEnabled && terminalFocus && terminalShellIntegrationEnabled && !accessibilityModeEnabled && terminalShellType == 'pwsh'",
"args": {
"text": "\u001b[24~e"
},
"skipShell": true
}
]
},
{
"FirstNormalized": "Ctrl+v",
"PSReadLine": {
"Key": "Ctrl+v",
"Function": "Paste",
"Description": "Paste text from the system clipboard",
"Group": 0
},
"VSCode": [
{
"key": "ctrl+v",
"command": "editor.action.clipboardPasteAction"
},
{
"key": "ctrl+v",
"command": "workbench.action.terminal.paste",
"when": "terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported",
"skipShell": true
},
{
"key": "ctrl+v",
"command": "workbench.action.terminal.sendSequence",
"when": "terminalFocus && !accessibilityModeEnabled && terminalShellType == 'pwsh'",
"args": {
"text": "\u0016"
},
"skipShell": true
}
]
},
{
"FirstNormalized": "Ctrl+w",
"PSReadLine": {
"Key": "Ctrl+w",
"Function": "BackwardKillWord",
"Description": "Move the text from the start of the current or previous word to the cursor to the kill ring",
"Group": 0
},
"VSCode": [
{
"key": "ctrl+w",
"command": "workbench.action.closeActiveEditor"
},
{
"key": "ctrl+w",
"command": "workbench.action.terminal.killEditor",
"when": "terminalEditorFocus && terminalFocus && terminalHasBeenCreated && resourceScheme == 'vscode-terminal' || terminalEditorFocus && terminalFocus && terminalProcessSupported && resourceScheme == 'vscode-terminal'",
"skipShell": true
}
]
},
{
"FirstNormalized": "Ctrl+x",
"PSReadLine": {
"Key": "Ctrl+x",
"Function": "Cut",
"Description": "Delete selected region placing deleted text in the system clipboard",
"Group": 0
},
"VSCode": {
"key": "ctrl+x",
"command": "editor.action.clipboardCutAction"
}
},
{
"FirstNormalized": "Ctrl+y",
"PSReadLine": {
"Key": "Ctrl+y",
"Function": "Redo",
"Description": "Redo an undo",
"Group": 0
},
"VSCode": {
"key": "ctrl+y",
"command": "redo"
}
},
{
"FirstNormalized": "Ctrl+z",
"PSReadLine": {
"Key": "Ctrl+z",
"Function": "Undo",
"Description": "Undo a previous edit",
"Group": 0
},
"VSCode": {
"key": "ctrl+z",
"command": "undo"
}
},
{
"FirstNormalized": "Delete",
"PSReadLine": {
"Key": "Delete",
"Function": "DeleteChar",
"Description": "Delete the character under the cursor",
"Group": 0
},
"VSCode": {
"key": "delete",
"command": "workbench.action.terminal.killActiveTab",
"when": "terminalHasBeenCreated && terminalTabsFocus || terminalIsOpen && terminalTabsFocus || terminalProcessSupported && terminalTabsFocus"
}
},
{
"FirstNormalized": "DownArrow",
"PSReadLine": {
"Key": "DownArrow",
"Function": "NextHistory",
"Description": "Replace the input with the next item in the history",
"Group": 2
},
"VSCode": {
"key": "down",
"command": "workbench.action.terminal.selectNextSuggestion",
"when": "terminalFocus && terminalHasBeenCreated && terminalIsOpen && terminalSuggestWidgetVisible || terminalFocus && terminalIsOpen && terminalProcessSupported && terminalSuggestWidgetVisible",
"skipShell": true
}
},
{
"FirstNormalized": "Enter",
"PSReadLine": {
"Key": "Enter",
"Function": "AcceptLine",
"Description": "Accept the input or move to the next line if input is missing a closing token.",
"Group": 0
},
"VSCode": [
{
"key": "enter",
"command": "workbench.action.terminal.findPrevious",
"when": "terminalFindInputFocused && terminalHasBeenCreated || terminalFindInputFocused && terminalProcessSupported",
"skipShell": true
},
{
"key": "enter",
"command": "workbench.action.terminal.acceptSelectedSuggestion",
"when": "terminalFocus && terminalHasBeenCreated && terminalIsOpen && terminalSuggestWidgetVisible || terminalFocus && terminalIsOpen && terminalProcessSupported && terminalSuggestWidgetVisible",
"skipShell": true
}
]
},
{
"FirstNormalized": "Escape",
"PSReadLine": {
"Key": "Escape",
"Function": "RevertLine",
"Description": "Equivalent to undo all edits (clears the line except lines imported from history)",
"Group": 0
},
"VSCode": [
{
"key": "escape",
"command": "workbench.action.terminal.clearSelection",
"when": "terminalFocusInAny && terminalHasBeenCreated && terminalTextSelected && !terminalFindVisible || terminalFocusInAny && terminalProcessSupported && terminalTextSelected && !terminalFindVisible",
"skipShell": true
},
{
"key": "escape",
"command": "workbench.action.terminal.hideFind",
"when": "terminalFindVisible && terminalFocus && terminalHasBeenCreated || terminalFindVisible && terminalFocus && terminalProcessSupported",
"skipShell": true
},
{
"key": "escape",
"command": "workbench.action.terminal.hideSuggestWidget",
"when": "terminalFocus && terminalHasBeenCreated && terminalIsOpen && terminalSuggestWidgetVisible || terminalFocus && terminalIsOpen && terminalProcessSupported && terminalSuggestWidgetVisible",
"skipShell": true
}
]
},
{
"FirstNormalized": "F1",
"PSReadLine": {
"Key": "F1",
"Function": "ShowCommandHelp",
"Description": "Shows help for the command at the cursor in an alternate screen buffer.",
"Group": 5
},
"VSCode": {
"key": "f1",
"command": "workbench.action.showCommands",
"skipShell": true
}
},
{
"FirstNormalized": "F2",
"PSReadLine": {
"Key": "F2",
"Function": "SwitchPredictionView",
"Description": "Switch between the inline and list prediction views.",
"Group": 4
},
"VSCode": {
"key": "f2",
"command": "workbench.action.terminal.renameActiveTab",
"when": "terminalHasBeenCreated && terminalTabsFocus && terminalTabsSingularSelection || terminalProcessSupported && terminalTabsFocus && terminalTabsSingularSelection"
}
},
{
"FirstNormalized": "F3",
"PSReadLine": {
"Key": "F3",
"Function": "CharacterSearch",
"Description": "Read a character and move the cursor to the next occurrence of that character",
"Group": 7
},
"VSCode": {
"key": "f3",
"command": "workbench.action.terminal.findNext",
"when": "terminalFindFocused && terminalHasBeenCreated || terminalFindFocused && terminalProcessSupported || terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported",
"skipShell": true
}
},
{
"FirstNormalized": "PageDown",
"PSReadLine": {
"Key": "PageDown",
"Function": "ScrollDisplayDown",
"Description": "Scroll the display down one screen",
"Group": 5
},
"VSCode": {
"key": "pagedown",
"command": "workbench.action.terminal.selectNextPageSuggestion",
"when": "terminalFocus && terminalHasBeenCreated && terminalIsOpen && terminalSuggestWidgetVisible || terminalFocus && terminalIsOpen && terminalProcessSupported && terminalSuggestWidgetVisible",
"skipShell": true
}
},
{
"FirstNormalized": "PageUp",
"PSReadLine": {
"Key": "PageUp",
"Function": "ScrollDisplayUp",
"Description": "Scroll the display up one screen",
"Group": 5
},
"VSCode": {
"key": "pageup",
"command": "workbench.action.terminal.selectPrevPageSuggestion",
"when": "terminalFocus && terminalHasBeenCreated && terminalIsOpen && terminalSuggestWidgetVisible || terminalFocus && terminalIsOpen && terminalProcessSupported && terminalSuggestWidgetVisible",
"skipShell": true
}
},
{
"FirstNormalized": "Shift+Enter",
"PSReadLine": {
"Key": "Shift+Enter",
"Function": "AddLine",
"Description": "Move the cursor to the next line without attempting to execute the input",
"Group": 0
},
"VSCode": [
{
"key": "shift+enter",
"command": "workbench.action.terminal.findNext",
"when": "terminalFindInputFocused && terminalHasBeenCreated || terminalFindInputFocused && terminalProcessSupported",
"skipShell": true
},
{
"key": "shift+enter",
"command": "workbench.action.terminal.sendSequence",
"when": "terminalFocus && terminalShellIntegrationEnabled && !accessibilityModeEnabled && terminalShellType == 'pwsh'",
"args": {
"text": "\u001b[24~c"
},
"skipShell": true
}
]
},
{
"FirstNormalized": "Shift+F3",
"PSReadLine": {
"Key": "Shift+F3",
"Function": "CharacterSearchBackward",
"Description": "Read a character and move the cursor to the previous occurrence of that character",
"Group": 7
},
"VSCode": {
"key": "shift+f3",
"command": "workbench.action.terminal.findPrevious",
"when": "terminalFindFocused && terminalHasBeenCreated || terminalFindFocused && terminalProcessSupported || terminalFocus && terminalHasBeenCreated || terminalFocus && terminalProcessSupported",
"skipShell": true
}
},
{
"FirstNormalized": "Shift+Insert",
"PSReadLine": {
"Key": "Shift+Insert",
"Function": "Paste",
"Description": "Paste text from the system clipboard",
"Group": 0
},
"VSCode": {
"key": "shift+insert",
"command": "editor.action.clipboardPasteAction"
}
},
{
"FirstNormalized": "Tab",
"PSReadLine": {
"Key": "Tab",
"Function": "TabCompleteNext",
"Description": "Complete the input using the next completion",
"Group": 3
},
"VSCode": {
"key": "tab",
"command": "workbench.action.terminal.acceptSelectedSuggestion",
"when": "terminalFocus && terminalHasBeenCreated && terminalIsOpen && terminalSuggestWidgetVisible || terminalFocus && terminalIsOpen && terminalProcessSupported && terminalSuggestWidgetVisible",
"skipShell": true
}
},
{
"FirstNormalized": "UpArrow",
"PSReadLine": {
"Key": "UpArrow",
"Function": "PreviousHistory",
"Description": "Replace the input with the previous item in the history",
"Group": 2
},
"VSCode": {
"key": "up",
"command": "workbench.action.terminal.selectPrevSuggestion",
"when": "terminalFocus && terminalHasBeenCreated && terminalIsOpen && terminalSuggestWidgetVisible || terminalFocus && terminalIsOpen && terminalProcessSupported && terminalSuggestWidgetVisible",
"skipShell": true
}
}
]
CurrentUser/AllUsers
. DetermineCurrentHost/AllHosts
in the script if variants are necessary.%USERPROFILE%/.vscode/extensions/ms-vscode.powershell-2023.6.0/modules/PSReadLine"
. This forces the extension to use the new version. Whether this may have any side effects is a different matter. EDIT: As of 2023.8.0, the extension uses 2.3.4 by default.$ErrorActionPreference = 'Stop'
,Set-StrictMode -Version 3