Powershell not accepting Ctrl+R for command history search #523

Closed
opened 2026-01-30 21:54:18 +00:00 by claunia · 9 comments
Owner

Originally created by @avvertix on GitHub (Jan 17, 2019).

The powershell is not accepting anymore the Ctrl+R shortcut to show the command history search.

  • Your Windows build number: Microsoft Windows 10.0.17763.253
  • What you're doing and what's happening: (Copy & paste specific commands and their output, or include screen shots)

Usually in VSCode integrated terminal or directly in the Powershell I press Ctrl+R to get the fuzzy search over previously typed commands. But this time it writes ^R

powershell-back-search

  • What's wrong / what should be happening instead:

The expected behavior is to present the fuzzy search prompt, like in the screen below

sharedimage
  • Additional information

The gif of the failure is taken on a Windows 10 (10.0.17763.253) installation with Italian localization, while the expected behavior was taken on a Windows 10 (10.0.17763.253) installation with English localization.

I tried to date back when the wrong behavior first appeared, and my conclusion was after the January patch tuesday, when I finally let install the Windows 1809 feature update along with KB4480116, KB4480979 and KB4480056.

On the English localized laptop the 1809 upgrade was done in December and has the additional KB4468550 update installed, which was not presented on the Italian localized desktop computer.

In addition I should mention that the desktop was previously Windows 7 and upgraded to Windows 10, while the laptop came with Windows 10 pre-installed.

Originally created by @avvertix on GitHub (Jan 17, 2019). The powershell is not accepting anymore the `Ctrl+R` shortcut to show the command history search. * Your Windows build number: `Microsoft Windows 10.0.17763.253` * What you're doing and what's happening: (Copy & paste specific commands and their output, or include screen shots) Usually in VSCode integrated terminal or directly in the Powershell I press `Ctrl+R` to get the fuzzy search over previously typed commands. But this time it writes `^R` ![powershell-back-search](https://user-images.githubusercontent.com/5672748/51307813-e4c73380-1a40-11e9-8a66-2aa4a455a744.gif) * What's wrong / what should be happening instead: The expected behavior is to present the fuzzy search prompt, like in the screen below <img width="613" alt="sharedimage" src="https://user-images.githubusercontent.com/5672748/51307454-04aa2780-1a40-11e9-963a-2ceb61df60ed.png"> * Additional information The gif of the failure is taken on a Windows 10 (`10.0.17763.253`) installation with Italian localization, while the expected behavior was taken on a Windows 10 (`10.0.17763.253`) installation with English localization. I tried to date back when the wrong behavior first appeared, and my conclusion was after the January patch tuesday, when I finally let install the Windows 1809 feature update along with `KB4480116`, `KB4480979` and `KB4480056`. On the English localized laptop the 1809 upgrade was done in December and has the additional `KB4468550` update installed, which was not presented on the Italian localized desktop computer. In addition I should mention that the desktop was previously Windows 7 and upgraded to Windows 10, while the laptop came with Windows 10 pre-installed.
claunia added the Resolution-ExternalProduct-Powershell labels 2026-01-30 21:54:18 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Jan 17, 2019):

Do you have PSReadline installed and enabled?

I'm fairly confident this would be a PSReadline issue that should be reported over at lzybkr/PSReadline or PowerShell/PowerShell.

Also, summoning @SteveL-MSFT

@zadjii-msft commented on GitHub (Jan 17, 2019): Do you have PSReadline installed and enabled? I'm fairly confident this would be a PSReadline issue that should be reported over at [lzybkr/PSReadline](https://github.com/lzybkr/PSReadline) or [PowerShell/PowerShell](https://github.com/PowerShell/PowerShell). Also, summoning @SteveL-MSFT
Author
Owner

@DHowett-MSFT commented on GitHub (Jan 17, 2019):

If you're seeing this on a localized versions of windows, chances are you're hitting the same issue that caused #348 (lzybkr/PSReadLine#614). Could you follow the diagnostic steps in there?

If you run Get-PSReadLineOption and see an error regarding the PSReadline assembly, it's the same issue.

@DHowett-MSFT commented on GitHub (Jan 17, 2019): If you're seeing this on a localized versions of windows, chances are you're hitting the same issue that caused #348 (lzybkr/PSReadLine#614). Could you follow the diagnostic steps in there? If you run `Get-PSReadLineOption` and see an error regarding the PSReadline assembly, it's the same issue.
Author
Owner

@avvertix commented on GitHub (Jan 17, 2019):

Indeed seems that the same error in https://github.com/Microsoft/console/issues/348#issuecomment-454127781 is popping-up

Get-PSReadLineOption : L'inizializzatore di tipo di 'Microsoft.PowerShell.PSConsoleReadLine' ha generato un'eccezione.
In riga:1 car:1
+ Get-PSReadLineOption
+ ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-PSReadLineOption], TypeInitializationException
    + FullyQualifiedErrorId : System.TypeInitializationException,Microsoft.PowerShell.GetPSReadLineOption
@avvertix commented on GitHub (Jan 17, 2019): Indeed seems that the same error in https://github.com/Microsoft/console/issues/348#issuecomment-454127781 is popping-up ``` Get-PSReadLineOption : L'inizializzatore di tipo di 'Microsoft.PowerShell.PSConsoleReadLine' ha generato un'eccezione. In riga:1 car:1 + Get-PSReadLineOption + ~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Get-PSReadLineOption], TypeInitializationException + FullyQualifiedErrorId : System.TypeInitializationException,Microsoft.PowerShell.GetPSReadLineOption ```
Author
Owner

@avvertix commented on GitHub (Jan 17, 2019):

So a quick test of solution 1 in #348 works for me.

close all powershell instances, change keyboard layout to en-US, re-open powershell

From a preliminary test, changing back the keyboard layout to the localized one after opening the Powershell seems to preserve the correct handling of keyboard shortcuts.

@avvertix commented on GitHub (Jan 17, 2019): So a quick test of [solution 1 in #348](https://github.com/Microsoft/console/issues/348#issuecomment-454302070) works for me. > close all powershell instances, change keyboard layout to en-US, re-open powershell From a preliminary test, changing back the keyboard layout to the localized one after opening the Powershell seems to preserve the correct handling of keyboard shortcuts.
Author
Owner

@SteveL-MSFT commented on GitHub (Jan 22, 2019):

The issue of PSReadLine no starting on non-en-US keyboard layout is understood and fixed in master branch. Working on getting a fix out, but it's not as easy or quick as making a change on GitHub.

@SteveL-MSFT commented on GitHub (Jan 22, 2019): The issue of PSReadLine no starting on non-en-US keyboard layout is understood and fixed in master branch. Working on getting a fix out, but it's not as easy or quick as making a change on GitHub.
Author
Owner

@DHowett-MSFT commented on GitHub (Feb 6, 2019):

Closing confirmed external. Thanks for the report!

@DHowett-MSFT commented on GitHub (Feb 6, 2019): Closing confirmed external. Thanks for the report!
Author
Owner

@sebj54 commented on GitHub (Mar 4, 2019):

For those like me who are having this issue on a fresh install of Windows, you'll find a way to resolve the issue here: https://github.com/lzybkr/PSReadLine#upgrading.

TLDR: PSReadLine is now shipped with W10, update it!

@sebj54 commented on GitHub (Mar 4, 2019): For those like me who are having this issue on a fresh install of Windows, you'll find a way to resolve the issue here: https://github.com/lzybkr/PSReadLine#upgrading. TLDR: PSReadLine is now shipped with W10, update it!
Author
Owner

@augustl commented on GitHub (Oct 17, 2020):

For future people doing web searches, I had this problem, and found this issue. I could run Get-PSReadLineOption just fine and all was fine and jolly on that end.

Turns out that I was the problem, not Powershell. I had configured Windows Terminal to start PowerShell like this:

"commandline": "powershell.exe -NonInteractive -ExecutionPolicy RemoteSigned",

Turns out that's not such a good idea! Remove the -NonInteractive part, and you're all good 👍

"commandline": "powershell.exe -ExecutionPolicy RemoteSigned",

I probably copy pasted it from somewhere without giving it too much thought.

@augustl commented on GitHub (Oct 17, 2020): For future people doing web searches, I had this problem, and found this issue. I could run `Get-PSReadLineOption` just fine and all was fine and jolly on that end. Turns out that I was the problem, not Powershell. I had configured Windows Terminal to start PowerShell like this: ``` "commandline": "powershell.exe -NonInteractive -ExecutionPolicy RemoteSigned", ``` Turns out that's not such a good idea! Remove the `-NonInteractive` part, and you're all good 👍 ``` "commandline": "powershell.exe -ExecutionPolicy RemoteSigned", ``` I probably copy pasted it from somewhere without giving it too much thought.
Author
Owner

@lackovic commented on GitHub (Oct 4, 2024):

I had the same problem and fixed it by running the following command in an elevated shell and then restarting it:

Install-Module PSReadLine -Force -SkipPublisherCheck -scope allusers
@lackovic commented on GitHub (Oct 4, 2024): I had the same problem and fixed it by running the following command in an elevated shell and then restarting it: ```powershell Install-Module PSReadLine -Force -SkipPublisherCheck -scope allusers ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#523