20

Since updating to Windows 10 v1809, pressing Shift+Space no longer sends a space in Powershell v5. If I use an older Windows 10 station (v1709), Shift+Space sends a space.

For example, I'm accustomed to pressing the following sequence of keys:

g, c, i, Shift+Space, |.

In v1803, this would result with gci |. In v1809, the result is gci|.

Is this key combination conflicting with something recently introduced? The problem is reproducible on multiple stations. If I'm working in a text editor, the problem doesn't exist. Launching PS with -NoProfile has no impact.

Additionally, this has only affected my installation of PS 5.1. In my installation of PS Core 6.0.2, Shift+Space still sends a space.

root
  • 3,920

2 Answers2

20

It seems like you need to update the PowerShellGet and PSReadLine Module to make shift+space work again.

  1. Open PowerShell as admin
  2. Run install-module -name powershellget -force
  3. Restart PowerShell (as admin)
  4. Run install-module -name psreadline -allowprerelease -force
  5. Restart PowerShell again

This should do it and it should work again.

Source: https://www.reddit.com/r/sysadmin/comments/9n9mh0/powershell_51_shiftspace_problem/

SimonS
  • 9,869
14

This seems to be "broken" again in PowerShell 5.1.x. That is, Get-PSReadLineKeyHandler shows no mapping associated with Shift+Spacebar, and pressing shift+space has no effect whatsoever.

Explicitly enabling it with Set-PSReadLineKeyHandler -Chord Shift+Spacebar -Function SelfInsert fixes the issue (pressing shift+space inserts space character), but the mapping will not show in the Get-PSReadLineKeyHandler listing as is, but as plain Space mapping.

huoneusto
  • 251