Skip to content

ctrl+p in VSCode doesn't work #6245

Closed as not planned
Closed as not planned

Description

@VDuchauffour

Question

Hi,
The keybindings ctrl+p to see commands doesn't work on my VSCode setup. On my setup, ctrl+p is mapped to go to file but the when condition is empty. I guess, there will be a condition to add to avoid running this keybinding when on a terminal or in the opencode extension. Any ideas how to do this ? Thanks

Activity

  1. github-actions commented on Dec 27, 2025

    @github-actions
    Contributor

    For keybind-related issues, please also check our pinned keybinds documentation: #4997

    This issue might be related to existing issues about keybind conflicts and configuration:

    The core issue here is that VSCode's built-in ctrl+p (Go to File) command is taking precedence over the OpenCode extension's keybinding. This is a known challenge with VSCode extension keybindings where the when condition needs to be properly configured to ensure the extension's keybind only triggers in the appropriate context.

  2. altendky commented on Jan 8, 2026

    @altendky
    Contributor

    yeah, everything is going to collide with something in vscode it seems... i reconfigured mine to map to ctrl+o to get around this conflict.

  3. jaens commented on Feb 1, 2026

    @jaens

    FYI since Quick Open in VSCode can be activated with many different keys (eg. Ctrl+E or Ctrl+Shift+P & Backspace), one workaround is to just disable the Ctrl+P shortcut in terminals.

    Add the following to keybindings.json:

        {
            "key": "ctrl+p",
            "command": "workbench.action.quickOpen",
            "when": "!terminalFocus",
        },
        {
            "key": "ctrl+p",
            "command": "-workbench.action.quickOpen",
        },
  4. remkolems commented on Feb 13, 2026

    @remkolems

    GUI mode also available.

    See also https://code.visualstudio.com/docs/configure/keybindings.

    My default keyboard mapping Ctrl+p was set to Go to File... (same command was also provided by Ctrl+e). So I simply removed the Ctrl+p mapping.

    Use right mouse menu option Change when expression to alter the expression state. e.g. with !terminalFocus :
    Image

  5. ShiinaManatsu commented on Mar 17, 2026

    @ShiinaManatsu

    keybindings

    The same as esc

        {
            "key": "esc",
            "command": "workbench.action.quickOpen",
            "when": "!terminalFocus",
        },
        {
            "key": "esc",
            "command": "-workbench.action.quickOpen",
        },
  6. easyfrog commented on Apr 5, 2026

    @easyfrog

    Why doesn't use /settings or something like other tools?

  7. Shyryp commented on Apr 27, 2026

    @Shyryp

    Seriously, make it possible to access settings via /settings. Using hotkeys is inconvenient and incorrect for many IDEs.

  8. astrojuanlu commented on May 7, 2026

    @astrojuanlu

    Or ctrl+x , ?

  9. altendky commented on May 7, 2026

    @altendky
    Contributor

    fwiw, vscode is wildly anti-terminal in terms of consuming commonly used terminal keys. but sure, a /settings or similar sounds like a complementary command to have.

  10. ameerhamzakhanDev commented on Jun 2, 2026

    @ameerhamzakhanDev

    Solution: Resolving VS Code and OpenCode Terminal Keybinding Conflicts

    The issue occurs because VS Code globally intercepts certain shortcuts — such as Ctrl+P (Go to File) and Ctrl+F (Find) — even when the terminal is focused. This prevents CLI/TUI applications running in your terminal, like OpenCode, from receiving those inputs.

    To fix this, you can configure VS Code to bypass its global shortcuts and pass those keys directly to the active terminal shell.


    Solution: Update your VS Code settings.json

    The cleanest way to fix this is to add the conflicting commands to the terminal.integrated.commandsToSkipShell array with a minus - prefix. This instructs VS Code to skip its own internal command when the terminal is active.

    1. Open the Command Palette in VS Code (Ctrl+Shift+P or Cmd+Shift+P on macOS).
    2. Type and select: Preferences: Open User Settings (JSON).
    3. Paste the following configuration block inside the outer curly braces { } of your settings.json:
    {
      "terminal.integrated.commandsToSkipShell": [
        "-workbench.action.quickOpen",                // Fixes ctrl+p and ctrl+e
        "-workbench.action.toggleSidebarVisibility",  // Fixes ctrl+b
        "-workbench.action.togglePanel",              // Fixes ctrl+j (hides terminal)
        "-workbench.action.quickOpenRecent",          // Fixes ctrl+r
        "-workbench.action.showAllSymbols",           // Fixes ctrl+t
        "-actions.find",                              // Fixes ctrl+f
        "-workbench.action.terminal.focusFind",       // Fixes ctrl+f inside terminal
        "-workbench.action.gotoLine",                 // Fixes ctrl+g
        "-workbench.action.closeActiveEditor",        // Fixes ctrl+w (closes tab)
        "-workbench.action.terminal.killEditor",      // Fixes ctrl+w in editor terminals
        "-editor.action.selectAll",                   // Fixes ctrl+a
        "-workbench.action.files.newUntitledFile",    // Fixes ctrl+n
        "-editor.action.quickFix",                    // Fixes ctrl+.
        "-workbench.action.zoomOut",                  // Fixes ctrl+-
        "-editor.action.rename"                       // Fixes f2
      ],
      "terminal.integrated.allowChords": false        // Prevents ctrl+k from waiting for a second chord key
    }
  11. rekram1-node commented on Jun 23, 2026

    @rekram1-node
    Collaborator

    Automated: closing question issues.

    GitHub Issues are for bug reports and feature requests only — questions / support are no longer tracked here.

    If this is a bug or feature request, please open a new issue with the appropriate template.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions