xtermjs / xterm.js

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

Text selection highlight still remains visible after scrolling in the terminal #5198

Open jolgau opened 1 month ago

jolgau commented 1 month ago

When I'm selecting a text in the viewport, after I scroll, a small highlight of the previous text still remains clinging on the viewport.

Had to fix it by providing this class:

.xterm-selection { overflow: hidden; }

Screenshot 2024-10-28 at 11 02 59 Screenshot 2024-10-28 at 11 03 05

Tyriar commented 1 month ago

I can't reproduce this, are you on the latest version (@xterm/xterm) and are you doing something atypical with the scrolling? For example are you creating a tall terminal and wrapping that with your own scroll bar?

jtbandes commented 2 weeks ago

For what it's worth, I saw this too. At first I assumed it was an intentional feature, but it seems to behave a bit weirdly (always shows up at the top even if the selection is scrolled off the bottom of the window). It's reproducible with minimal configuration: https://codesandbox.io/p/sandbox/xtermjs-test-forked-rfznf7

(Chrome 131.0.6778.70, macOS 15.1)

https://github.com/user-attachments/assets/750a2d06-6e51-4eeb-aa33-1da037275a2b

JunisXu commented 2 weeks ago

@Tyriar 遇到了相同问题, 1.如果使用HTML渲染方式,会出现灰块,一直悬浮在顶部, image 2.如果使用webgl方式渲染,则会出现,最后一行,复制时选中行错乱问题(有尝试过增大行高依旧无效) image 请给出解决方案,急!!!!

Tyriar commented 1 week ago

It's unclear why I don't see this in VS Code either 🤔