Skip to content

getSelection() does not return a single character selection #2617

@theflyingape

Description

@theflyingape

Relates to: #2244
This works fine when a double-click highlights a word selection > 1 character. But if the selection only highlights a single character, getSelection() returns an empty string. Is this by design?

Details

  • Browser and browser version: Chrome 78
  • OS version: Linux
  • xterm.js version: 4.3.0

Steps to reproduce

  1. ITerminalOptions.wordSeparator = ` .:;?!"'<>(/)[=]`
  2. term.write('Sex (M/F)? ')
  3. double-click the 'M'
  4. getSelection() returns ''

Online example: https://play.ddgame.us

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions