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

Text selection highlight still remains visible after scrolling in the terminal

Open jolgau opened this issue 1 year ago • 7 comments

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

jolgau avatar Oct 28 '24 09:10 jolgau

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?

Tyriar avatar Oct 28 '24 12:10 Tyriar

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

jtbandes avatar Nov 18 '24 23:11 jtbandes

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

JunisXu avatar Nov 19 '24 10:11 JunisXu

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

Tyriar avatar Nov 20 '24 12:11 Tyriar

I am facing the same problem, after selecting some thing and scroll selected text out of view, there will be some mask over the first line make content not visible

https://github.com/user-attachments/assets/c3ee66e2-ec0e-4141-a2ef-6cb19572d388

Sczlog avatar Apr 28 '25 07:04 Sczlog

我也遇到相同得问题,一段文字被选中时,然后上下滚动鼠标滑轮,

Image

上面这个图中的top值,当超出上下边界时这个top值。

yuzw1007 avatar Jun 06 '25 03:06 yuzw1007

Hi, any updates on this issue?

myarmolinsky avatar Jul 22 '25 14:07 myarmolinsky