Skip to content

SHIFT+END on Linux WSL generates an escape sequence #18

Description

@xoofx

When pressing SHIFT+END with the following program:

using System;

namespace TestConsole
{
    class Program
    {
        static void Main(string[] args)
        {
            // Console.TreatControlCAsInput = true;
            while (true)
            {
                var key = Console.ReadKey(true);
                Console.WriteLine($"Key: {key.Key} Modifiers: {key.Modifiers} Char: {(key.KeyChar < ' ' || (int)key.KeyChar >= 126 ? "0x" + ((int)key.KeyChar).ToString("x2") : key.KeyChar.ToString())}");
                if (key.Key == ConsoleKey.C && (key.Modifiers & ConsoleModifiers.Control) != 0)
                {
                    break;
                }
            }
        }
    }
}

It generates the following sequence on Linux:

Key: Escape Modifiers: 0 Char: 0x1b
Key: D1 Modifiers: 0 Char: 1
Key: 0 Modifiers: 0 Char: ;
Key: D2 Modifiers: 0 Char: 2
Key: F Modifiers: Shift Char: F

instead of generating the following on Windows:

Key: End Modifiers: Shift Char: 0x00

In kalk, it's breaking the start selection + move cursor to end, while SHIFT+HOME is working just fine.

So it's either a bug in .NET or in WSL. I haven't checked this in a VM/real Linux so see how it behaves...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions