Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spinners in console applications make selection difficult #318

Closed
Tyriar opened this issue Oct 22, 2016 · 5 comments
Closed

Spinners in console applications make selection difficult #318

Tyriar opened this issue Oct 22, 2016 · 5 comments

Comments

@Tyriar
Copy link
Member

Tyriar commented Oct 22, 2016

From what I can see, spinners like in npm or https://github.com/sindresorhus/elegant-spinner cause the entire viewport to be destroyed and re-rendered. I believe this is why selecting text is difficult when a spinner is active. If the entire viewport is indeed being re-created this certainly wouldn't be good for laptopbattery either.

Details

  • Browser and browser version: VS Code/electron
  • OS version: Ubuntu 16.04
  • xterm.js version: 8a124d0

Steps to reproduce

  1. Clone vscode
  2. Run ./scripts/npm.sh install --arch=x64
  3. Try selecting text in the terminal
@Tyriar Tyriar added the type/enhancement Features or improvements to existing features label Oct 22, 2016
@parisk
Copy link
Contributor

parisk commented Oct 23, 2016

I think the issue might be here: https://github.com/sourcelair/xterm.js/blob/master/src/xterm.js#L1075.

If this is a "big refresh", then xterm.js removes all rows from the DOM for faster calculations and this messes up with selections.

I am not sure what could be the best solution here. Three things come in mind:

  1. Smartly update the DOM contents of the terminal in order to avoid messing up with selection
  2. Restoring selection programmatically after a refresh (which might feel patchy for the user)
  3. Implement virtual selection Implement virtual selection #207

While 3. needs the most effort to get right, I guess that it is the best and most future-proof solution.

@Tyriar
Copy link
Member Author

Tyriar commented Oct 23, 2016

Well if we can shift the elements upwards without removing the elements from .xterm-rows (1.) and the selection is retained then this would be an ideal step before 3.

@akalipetis
Copy link
Contributor

We could also use HTML fragments and partially updating them. This would be a nice idea too IMO.

After a quick Google search I found this one: https://github.com/fiduswriter/diffDOM

@Tyriar
Copy link
Member Author

Tyriar commented Apr 3, 2017

Duplicate #468

@Tyriar Tyriar closed this as completed Apr 3, 2017
@Tyriar Tyriar added duplicate and removed type/enhancement Features or improvements to existing features labels Apr 3, 2017
@Tyriar
Copy link
Member Author

Tyriar commented Jun 9, 2017

Fixed in #670

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants