The VI-mode commands f' , f" , t' and t" insert ' or " instead of moving the cursor when running on Windows when using the International Layout (dead keys)
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Domain
- cli, operating-systems
Research direction
Start by reproducing the bug in PSReadLine's Vi-mode f/F/t/T commands on Windows with the United States-International keyboard layout, comparing it with the US layout and WSL2 behavior. Trace the Windows input handling for dead keys, then verify that pressing the dead key followed by Space moves to the requested character without ringing the bell or inserting it.
Written by the indexing model from the issue text.
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
Print showing that when I try to use F" or F' it prints the character instead of moving the cursor to the previous ocurrence of the character.
Environment data
PS Version: 7.2.13
PS HostName: ConsoleHost
PSReadLine Version: 2.2.6
PSReadLine EditMode: Vi
OS: 10.0.19041.320 (WinBuild.160101.0800)
BufferWidth: 120
BufferHeight: 9001
Steps to reproduce
(The following steps can be made replacing ' for " or `)
- Set the Windows language layout to United States-International
- Write anything with an ' on it on PowerShell
- Press ESC to go the VI-mode's normal mode
- Try to move to the written character with f' or t' (or if the character is to the left of the cursor with F' or T')
(the key here is used to send the ' key directly instead of merging it with another key since in this layout it's a dead key)
Expected behavior
The cursor should move to the desired character, exactly like it happens on the US layout (the only difference should be the need to press space after ' or " or `).
Actual behavior
When running it on WSL2 it works exactly as expected - since it's a dead key on US International Layout when I press f " it waits the next key and if I press space (to insert the " character) it searches for next ocorrence of the " character. But when running on Windows it doesn't seem to recognize the dead key and fails the command as soon as I press any of it.
I've noticed it sends a bell as soon as I press the dead key (if I press d f and then ' as soon as the ' is first pressed it sounds the bell), which I believe indicates that the previous command failed/was cancelled and then when I press space it prints the character (if I press the same accent again it prints it twice) which would be the expected behaviour if I was on insert mode and not chaining commands on normal mode.
I've made tests with the US keyboard layout and it works fine. Also, some accented words like à or á (that are written with the keys a backtick and a ' trigger the same behavior, just printing the character instead of moving the cursor.
As an additional info the ^ key is also a dead key on this layout but has a different behaviour - it doesn't ring any bell, and when chained to command it just ignores the command and goes to the start of the line (the expected behaviour when the command is like d^ would for it to delete until the start of the line, not just go there).
I've also made many tests like using Windows Terminal or conhost and using both PowerShell 5 and PowerShell 7 versions (with the latest preview of PSReadLine). So far it only happens on Windows and when using the United States-Internatial layout (which is the one I use to be able to write both english and portuguese on my ANSI layout keyboard)
- Dominant language
- C#
- Stars
- 4.4k
- Forks
- 341
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PowerShell/PSReadLine
-
Needs-Triage :mag:
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
PowerShell/PSReadLine#5205 ·
-
Needs-Triage :mag:
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
PowerShell/PSReadLine#5195 ·
-
Needs-Triage :mag:
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
PowerShell/PSReadLine#5121 ·
-
Needs-Triage :mag:
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
PowerShell/PSReadLine#5045 ·
-
Area-CommandHelp Issue-Enhancement
Difficulty 1/5 Under an hour Newbie friendliness 68/100
PowerShell/PSReadLine#3470 · 3 reactions ·
All issues in PowerShell/PSReadLine
Similar issues
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 75/100
sillsdev/languageforge-lexbox#2665 ·
-
bug documentation frontend
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
azurenoops/spin_agent#975 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
dotnet/AspNetCore.Docs#37699 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SubtitleEdit/subtitleedit#15108 · 1 comment ·