Skip to content

@xtermjs/addon-search regex case-sensitive should behave like monaco #5270

@esimkowitz

Description

@esimkowitz

Currently, the @xtermjs/addon-search plugin applies the case-sensitive flag to the full regex, which means that if it's false, meta-characters like \S, which is non-whitespace chars, will be interpreted as lowercase (in this case, \s is whitespace chars). Monaco uses a different method, where only non-meta chars are interpreted as case-sensitive when the regex flag is set. While it's kind of silly to treat a regex as case-insensitive, it makes sense for xtermjs and monaco to align on their implementation.

Details

  • Browser and browser version: Electron 33.2.1
  • OS version: macOS Sequoia 15.2
  • xterm.js version: 5.5.0

Steps to reproduce

  1. run echo "path wrath hath" in the VSCode terminal
  2. activate the terminal search, set case-sensitive and whole-word to false, and set regex to true
  3. type \S+th in the search bar
  4. observe that nothing is highlighted
  5. Open a new tab in VSCode and type path wrath hath into it as its only contents
  6. activate the Monaco search, set case-sensitive and whole-word to false, and set regex to true
  7. type \S+th in the search bar
  8. observe that each word is being highlighted separately

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions