Xterm.js: Selection is only possible on the text in the current viewport

Created on 2 Jun 2016  ·  4Comments  ·  Source: xtermjs/xterm.js

While potentially difficult, it's probably possible to do a smooth selection over multiple pages by:

  • Recording start selection position
  • Scroll the terminal up when dragging from terminal and cursor is close to/beyond top
  • Scroll the terminal down when dragging from terminal and cursor is close to/beyond bottom
  • Whenever the terminal is scrolled, reset the selection position
  • When copy is triggered, intercept and select the text between the start and end (probably won't work in older browsers)
typbug

All 4 comments

I think that this will be handled across with all other scrolling issues. The best thing to do IMO is bring scrolling as close as possible to native terminals found in modern OSs (e.g. Ubuntu Terminal and Terminal.app).

hterm handles this really well but only has the currently displayed viewport in the DOM. We should see how they implement it.

We could mimic the way https://github.com/codemirror/codemirror does it. This could also help with #77.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  ·  4Comments

Mlocik97-issues picture Mlocik97-issues  ·  3Comments

kolbe picture kolbe  ·  3Comments

parisk picture parisk  ·  3Comments

jerch picture jerch  ·  3Comments