PSReadLine
PSReadLine copied to clipboard
Word selection is too coarse, doesn't stop at non-letter characters
Currently, editing and selecting text, like expressions or file paths, in the PowerShell REPL is quite cumbersome because only letters (Regex \w character group) are considered word boundaries.
I would expect the cursor to stop at the next non-letter (Regex \W character group) character when navigating using CTRL + LEFT/RIGHT ARROW.
Prerequisites
- [x] Write a descriptive title.
- [x] Make sure you are able to repro it on the latest released version
- [x] Search the existing issues, especially the pinned issues.
Screenshot
Environment data
PS Version: 7.5.4
PS HostName: ConsoleHost
PSReadLine Version: 2.3.6
PSReadLine EditMode: Windows
OS: 10.0.19041.4406 (WinBuild.160101.0800)
BufferWidth: 120
BufferHeight: 9001
Steps to reproduce
- Enter a text like the one from the screenshot into a PowerShell window:
Out-File '.\Temp\Test.csv' - Move the cursor using CTRL + LEFT/RIGHT ARROW keys
Expected behavior
Pressing CTRL + SHIFT + LEFT/RIGHT ARROW keys, I'd expect text selection to switch from Temp... to \Temp..., then .\Temp..., '.\Temp..., File '.\Temp... etc.
Actual behavior
Pressing CTRL + SHIFT + LEFT/RIGHT ARROW keys, text selection switches from Temp... to File '.\Temp... etc.