I totally get it. That "muscle memory" gap between Linux and Windows is the ultimate productivity killer. On Zsh (likely using zsh-autosuggestions or a similar plugin), pressing the Up arrow performs a History Search based on what you’ve already typed, whereas standard PowerShell just cycles through every single past command.
The good news? You already have the right tool installed in your profile: PSReadLine. You just need to tell it to behave like your Linux setup.
Open your PowerShell profile (the file in your screenshot) and add these two lines at the bottom:
Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward
Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward
By default, the Up arrow in PowerShell is bound to PreviousHistory. By changing it to HistorySearchBackward, PowerShell will:
- Look at what you've already typed (e.g.,
git). - Filter your history to only show commands starting with
git. - Cycle through only those matches when you keep tapping Up.
Looking at your screenshot, here are two small tweaks to make your experience even closer to Zsh:
- The Right Arrow "Accept": If you see the "grayed out" text (Predictive IntelliSense) and want to accept it like you do in Zsh, the Right Arrow key usually handles this by default. If it doesn't, add:
Set-PSReadLineKeyHandler -Key RightArrow -Function AcceptSuggestion - Menu Completion: If you want a visual menu when you hit Tab (like Zsh), add:
Set-PSReadLineOption -PredictionSource HistoryAndPluginSet-PSReadLineKeyHandler -Key Tab -Function MenuComplete