Skip to content

Word selection is too coarse, doesn't stop at non-letter characters #5023

Description

@SetTrend

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

  • 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.

Screenshot

Word selection quite coarse

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

  1. Enter a text like the one from the screenshot into a PowerShell window:
    Out-File '.\Temp\Test.csv'
  2. 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.

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

    Needs-Triage 🔍It's a new issue that core contributor team needs to triage.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions