Implement more modern word-wise cursor navigations #20314

Open
opened 2026-01-31 07:09:57 +00:00 by claunia · 3 comments
Owner

Originally created by @lhecker on GitHub (Aug 1, 2023).

Description of the new feature/enhancement

Conhost and Windows Terminal currently use the classic Windows algorithm, which is also used by Notepad and Visual Studio. Given 3 classes of characters - whitespace, delimiters and regular text - it works something like this:

  • Forward navigation:
    • Skip text until (after) you encounter a different character class
    • Skip whitespace
  • Backward navigation:
    • Skip whitespace
    • Skip text until (before) you encounter a different character class

In comparison Visual Studio Code's navigation works like this:

  • Forward navigation:
    • Skip whitespace
    • Skip 1 glyph
    • Skip text until (before) you encounter a different character class
  • Backward navigation:
    • Skip whitespace
    • Skip 1 glyph
    • Skip text until (before) you encounter a different character class

Due to this symmetry navigating forward/backward will produce consistent and identical results. It'll feel more "intuitive" to new users.

Risk

People can be very picky about changes to our word selection algorithm. Double-clicking words needs to behave similar/identical to before. Cursor navigation needs to be at least so close that no one will feel bothered by it. There should be an opt-out if not at least via a registry key, just in case things go bad.

Originally created by @lhecker on GitHub (Aug 1, 2023). # Description of the new feature/enhancement Conhost and Windows Terminal currently use the classic Windows algorithm, which is also used by Notepad and Visual Studio. Given 3 classes of characters - whitespace, delimiters and regular text - it works something like this: * Forward navigation: * Skip text until (after) you encounter a different character class * Skip whitespace * Backward navigation: * Skip whitespace * Skip text until (before) you encounter a different character class In comparison Visual Studio Code's navigation works like this: * Forward navigation: * Skip whitespace * Skip 1 glyph * Skip text until (before) you encounter a different character class * Backward navigation: * Skip whitespace * Skip 1 glyph * Skip text until (before) you encounter a different character class Due to this symmetry navigating forward/backward will produce consistent and identical results. It'll feel more "intuitive" to new users. # Risk People can be _very_ picky about changes to our word selection algorithm. Double-clicking words needs to behave similar/identical to before. Cursor navigation needs to be at least so close that no one will feel bothered by it. There should be an opt-out if not at least via a registry key, just in case things go bad.
Author
Owner

@chrisant996 commented on GitHub (Aug 3, 2023):

@lhecker This is referring only to processed input mode in ReadConsole(), right?

@chrisant996 commented on GitHub (Aug 3, 2023): @lhecker This is referring only to processed input mode in ReadConsole(), right?
Author
Owner

@DHowett commented on GitHub (Aug 3, 2023):

Yup!

@DHowett commented on GitHub (Aug 3, 2023): Yup!
Author
Owner

@carlos-zamora commented on GitHub (Sep 10, 2024):

Screen readers also use the other kind of word navigation. So, when a user is navigating the buffer, it also feels really different and confusing.

@carlos-zamora commented on GitHub (Sep 10, 2024): Screen readers also use the other kind of word navigation. So, when a user is navigating the buffer, it also feels really different and confusing.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#20314