Skip to content

Shift+End key combination doesn't work in WSL prompt #3126

@HasEveryUsernameBeenTaken

Description

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues, especially the pinned issues.

Exception report

N/A

Screenshot

N/A

Environment data

PS Version: 7.2.1
PS HostName: ConsoleHost
PSReadLine Version: 2.1.0
PSReadLine EditMode: Windows
OS: Linux Porre-Ubuntu 4.4.0-19041-Microsoft #1237-Microsoft Sat Sep 11 14:32:00 PST 2021 x86_64 x86_64 x86_64 GNU/Linux
BufferWidth: 120
BufferHeight: 30

Steps to reproduce

  1. Open a Windows Subsystem for Linux window. I was able to produce this in the standard console window ("debian.exe" and "ubuntu.exe") and Windows Terminal ("WindowsTerminal.exe" and a GNU/Linux profile)
  2. Install PowerShell via the instructions in https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-linux?view=powershell-7.2
  3. Open PowerShell via "pwsh"
  4. Press and hold the Right Shift key
  5. Press the End key

I did verify that the key combination is bound via the following:

$ Get-PSReadLineKeyHandler -Chord 'Shift+End'

Selection functions
===================

Key       Function   Description
---       --------   -----------
Shift+End SelectLine Adjust the current selection to include from the cursor to the end of the line

Just in case this helps, here are the results of "showkey -a" for WSL Ubuntu for my End, Shift+End, CTRL+End, and ALT+End:

$ showkey -a

Press any keys - Ctrl-D will terminate this program

^[[F     27 0033 0x1b
         91 0133 0x5b
         70 0106 0x46
^[[1;2F          27 0033 0x1b
         91 0133 0x5b
         49 0061 0x31
         59 0073 0x3b
         50 0062 0x32
         70 0106 0x46
^[[1;5F          27 0033 0x1b
         91 0133 0x5b
         49 0061 0x31
         59 0073 0x3b
         53 0065 0x35
         70 0106 0x46
^[[1;3F          27 0033 0x1b
         91 0133 0x5b
         49 0061 0x31
         59 0073 0x3b
         51 0063 0x33
         70 0106 0x46

Expected behavior

The key combination should select from the currently focused cursor position to the end of the line.

Please note that the Shift+Home key combination seems to work correctly.

Actual behavior

Pressing the shift key and the end key inserts ";2F" in a console window and "^[1;2F" in Windows Terminal.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions