PowerShell / PSReadLine

A bash inspired readline implementation for PowerShell
BSD 2-Clause "Simplified" License
3.75k stars 296 forks source link

Extra character printed for some dead keys #1409

Closed hexawyz closed 1 year ago

hexawyz commented 4 years ago

Environment

PS version: 7.0.0
PSReadline version: 2.0.0
os: 10.0.17763.1091 (WinBuild.160101.0800)
PS file version: 7.0.0.0
HostName: ConsoleHost
BufferWidth: 160
BufferHeight: 9001

Exception report

N/A

Steps to reproduce

  1. Create a new layout with MSKLC and save it.
  2. Open the .klc file with your text editor of choice.
  3. In the LAYOUT part, change the line related to the key N to match the line below:
    31  N       1   n   N   -1  007e@   0131        // LATIN SMALL LETTER N, LATIN CAPITAL LETTER N, <none>, TILDE, LATIN SMALL LETTER DOTLESS I
  4. After the layout part, add the following definition for the dead key:

    DEADKEY 007e
    
    006e    00f1    // n -> ñ
    006f    00f5    // o -> õ
    0061    00e3    // a -> ã
    004e    00d1    // N -> Ñ
    004f    00d5    // O -> Õ
    0041    00c3    // A -> Ã
    0020    007e    //   -> ~
  5. Save the file and re-open it within MSKLC
  6. Build and install the created layout on your computer
  7. Using the installed layout (e.g. in Notepad), verify that the sequence Right Alt + n, Space generates ~
  8. Open Powershell and reproduce the same key sequence as above, and observe the result

Expected behavior

The typed sequence should appear as ~ in the shell.

Actual behavior

Instead, the sequence produces the text ñ~.

More details

I have this issue because at home, I'm using an Apple USB Keyboard (FR) with a layout matching the one from OSX. A typical case for running into this problem this problem is with a command such as git rebase -i HEAD~2. This might be related to #933 and the fact that the main character of the key is both printable and combinable with the dead key itself. (e.g. I don't have a problem with Shift+Right Alt+1,Space which correctly produces ´ using this layout) I should also have tested this scenario when you adressed #914 , sorry 😥

hexawyz commented 4 years ago

Just to add more details to this issue, I noticed today that this bug does not happen in the new Windows Terminal. (It still does within the legacy console host)

microsoft-github-policy-service[bot] commented 1 year ago

This issue is closed because it has had no activity and on older unsupported versions of PowerShell or PSReadLine. Please try again on latest versions of both and if its still an issue please submit a new issue.