xterm.js icon indicating copy to clipboard operation
xterm.js copied to clipboard

Using `letter-spacing` globally messes up selecting.

Open Linux123123 opened this issue 1 year ago • 13 comments

letter-spacing other then normal messes up with console text selecting.

Details

  • Browser and browser version: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36
  • OS version: n/a
  • xterm.js version: latest

Steps to reproduce

  1. Set letter spacing in body to anything other then normal (for example letter-spacing: 0.015em;)
  2. Observe selecting messing up

image image

Usually can get detected by trying to select from the end, or starting select on a space.

Linux123123 avatar Nov 14 '23 14:11 Linux123123

I cannot repro with master. Can you give a bit more information or a small screen cast showing the misbehavior?

jerch avatar Nov 14 '23 14:11 jerch

A simple reproduction https://codesandbox.io/p/sandbox/currying-dream-mk2ctn

Linux123123 avatar Nov 14 '23 15:11 Linux123123

Can repro some weirdness in normal selection and when holding alt: image

Recording 2023-11-14 at 07 27 12

Didn't check if it happens on tip of master though

Tyriar avatar Nov 14 '23 15:11 Tyriar

I can confirm that it still happens on "@xterm/xterm": "5.4.0-beta.14", which is like 5 days old.

Linux123123 avatar Nov 14 '23 16:11 Linux123123

Yeah can repro it with your example on FF and chrome. On a sidenote - the wrong doubled highlighting starts at half of the correct position, and letter-spacing is at 0.5em, hmm.

jerch avatar Nov 14 '23 16:11 jerch