Skip to content

Instantly share code, notes, and snippets.

@ben-alkov
Created August 12, 2025 17:31
Show Gist options
  • Select an option

  • Save ben-alkov/1329c25db38cf2ea7ae9ea7fdaf10d3a to your computer and use it in GitHub Desktop.

Select an option

Save ben-alkov/1329c25db38cf2ea7ae9ea7fdaf10d3a to your computer and use it in GitHub Desktop.
Fix "SHIFT+ENTER adds newline to chat" keymapping for VSCode on Fedora 42; YMMV
{
"command": "-acceptAlternativeSelectedSuggestion",
"key": "shift+enter",
"when": "suggestWidgetHasFocusedSuggestion && suggestWidgetVisible && textInputFocus"
},
{
"command": "-editor.action.extensioneditor.findPrevious",
"key": "shift+enter",
"when": "webviewFindWidgetFocused && !editorFocus && activeEditor == 'workbench.editor.extension'"
},
{
"command": "-editor.action.previousMatchFindAction",
"key": "shift+enter",
"when": "editorFocus && findInputFocussed"
},
{
"command": "-editor.action.webvieweditor.findPrevious",
"key": "shift+enter",
"when": "webviewFindWidgetFocused && !editorFocus && activeEditor == 'WebviewEditor'"
},
{
"command": "-editor.refocusCallHierarchy",
"key": "shift+enter",
"when": "callHierarchyVisible"
},
{
"command": "-editor.refocusTypeHierarchy",
"key": "shift+enter",
"when": "typeHierarchyVisible"
},
{
"command": "-interactive.execute",
"key": "shift+enter",
"when": "config.interactiveWindow.executeWithShiftEnter && isCompositeNotebook && activeEditor == 'workbench.editor.interactive'"
},
{
"command": "-repl.execute",
"key": "shift+enter",
"when": "config.interactiveWindow.executeWithShiftEnter && isCompositeNotebook && !notebookCellListFocused && activeEditor == 'workbench.editor.repl'"
},
{
"command": "-workbench.action.terminal.findNext",
"key": "shift+enter",
"when": "terminalFindInputFocused && terminalHasBeenCreated || terminalFindInputFocused && terminalProcessSupported"
},
{
"command": "-workbench.action.terminal.sendSequence",
"key": "shift+enter",
"when": "terminalFocus && terminalShellIntegrationEnabled && !accessibilityModeEnabled && terminalShellType == 'pwsh'"
},
{
"command": "workbench.action.terminal.sendSequence",
"key": "shift+enter",
"args": {
"text": "\u001B\u000A"
},
"when": "terminalFocus"
}
@ben-alkov
Copy link
Author

ben-alkov commented Aug 12, 2025

README:

NOTE: This is ONLY for use within CSCode-like. I don't fw trying to figure out keymappings for terminal progs; they always end up as some unholy combo of bash nerdery, terminal futzing. XInput smashing, and lord only knows what kind of abomination the Wayland architects have conjured...

TL;DR - Nuke ALL existing SHIFT+ENTER mappings from orbit (I truly cannot be fscked to ass around and figure out the conflict here).

The important bit is last in the list

    {
        "command": "workbench.action.terminal.sendSequence",
        "key": "shift+enter",
        "args": {
            "text": "\u001B\u000A"
        },
        "when": "terminalFocus"
    }

i.e. use Unicode escapes instead of jacking around with escape characters.

Manifesto:

AI types need to

  • Stop trying to ignore WELL-ESTABLISHED keymaps and come up with your own: e.g.
    • CTRL-K as a sequence prefix in VSCode (and earlier editors, IIRC)
    • SHIFT+ENTER see above, this should be the default, and should work properly/consistently on ALL claude-code platforms (but I'm not here to single out Anthropic)
  • Learn proper Python (e.g. I don't care how meaningful s (x, y, z, m, xs, ms, etc. to infinity) is in your mathematics - it is NOT a human-readable identifier in any sane programming language)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment