When I do ^R
on the terminal to reverse search, I get the following:
(^R) was pressed. Waiting for second key of chord...
How do I fix this? I'm on OS X.
Also see Run recent command as a replacement for reverse search from the v1.70 Release Notes:
When shell integration is enabled, we're aiming run recent command to be a cross-shell drop in replacement for the shell's reverse search (
kbstyle(Ctrl+R)
). There is a new contiguous search mode that is the default when triggering the command. This behaves likekbstyle(Ctrl+R)
in most shells, with the option of switching back to fuzzy search:
The new
inTerminalRunCommandPicker
context key is available that allows setting up a keybinding likekbStyle(Ctrl+R)
to go to the next match. For example, the following keybindings are now a fairly complete replacement for your shell's reverse search, withkbstyle(Ctrl+Alt+R)
as a fallback to the old behavior:
{ "key": "ctrl+r", "command": "workbench.action.terminal.runRecentCommand", "when": "terminalFocus" },
{ "key": "ctrl+alt+r", "command": "workbench.action.terminal.sendSequence", "args": { "text": "\u0012"/*^R*/ }, "when": "terminalFocus" },
{ "key": "ctrl+r", "command": "workbench.action.quickOpenNavigateNextInViewPicker", "when": "inQuickOpen && inTerminalRunCommandPicker" },
{ "key": "ctrl+c", "command": "workbench.action.closeQuickOpen", "when": "inQuickOpen && inTerminalRunCommandPicker" },
Perhaps you actually want both! Terminal keybindings that are of the form
Ctrl+R Ctrl+something else
that is, keybindings that are chords
AND still use
Ctrl+R (a non-chord keybinding) to trigger a reverse search in the terminal.
You can have both - add this keybinding to your keybindings.json:
{
"key": "ctrl+r",
"command": "workbench.action.terminal.sendSequence",
"args": { "text": "\u0012" },
"when": "terminalFocus"
},
That sends a "Ctrl+R" to the terminal and thus starts a reverse search. Even if you have other terminal keychords that starts with Ctrl+R, the terminal will not wait for the second part of a keybinding.
Note if you have a frequently used search you can add text to the command like:
"args": { "text": "\u0012node" },
where it will already have started the search for commands with node
in them.
I realized that this started happening with me after I installed "Visual Studio Keymap" extension.
That is how I solved:
Ctrl + Shift + P for the command. There write: "Settings JSON" and select the option that says "Preferences: Open Settings (JSON)"
There, write the following setting:
"terminal.integrated.allowChords": false
Save and be happy
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With