xtermjs / xterm.js

A terminal for the web
https://xtermjs.org/
MIT License
17.33k stars 1.61k forks source link

Weird visual glitch while selecting text in terminal to copy/paste #4952

Closed jayarjo closed 6 months ago

jayarjo commented 6 months ago

Details

Steps to reproduce

  1. Copying one word works, I click on a word and that gets selected, ctrl-insert to copy, etc.
  2. Copying one line works, I double click on the row and that gets selected, ctrl-insert to copy, etc.
  3. Painting many lines tends to work, I start from the above and paint down
    1. if I start on a row that is empty or has text AND end on a row that is empty or end up far to the right of the text
      1. this probably works wrong but because of the empty characters the copy-paste itself is “correct” visually
  4. Painting small sections tends to end up so that a number of characeters are missing at the end
    1. In the video, if you look closely, the missing characters vary from the end when the painted area is made larger/smaller

https://www.youtube.com/watch?v=IFK-RyOhp5w

Looks like a terminal erroneously interprets initial cursor position on initial mouse down.

jayarjo commented 6 months ago

Setting fontSize and fontFamily directly on Terminal instance helped - I had it set through CSS previously.