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

Selections in terminal should invert colors like in bash #7285

Closed
Tyriar opened this issue Jun 7, 2016 · 5 comments
Closed

Selections in terminal should invert colors like in bash #7285

Tyriar opened this issue Jun 7, 2016 · 5 comments
Assignees
Labels
accessibility Keyboard, mouse, ARIA, vision, screen readers (non-specific) issues feature-request Request for new features or functionality terminal General terminal issues that don't fall under another label
Milestone

Comments

@Tyriar
Copy link
Member

Tyriar commented Jun 7, 2016

Made a request to xterm xtermjs/xterm.js#75, it will be too tedious to do without scripting the CSS on our side though unless they go back to a JS API for theming.

@Tyriar Tyriar added feature-request Request for new features or functionality accessibility Keyboard, mouse, ARIA, vision, screen readers (non-specific) issues terminal General terminal issues that don't fall under another label labels Jun 7, 2016
@Tyriar Tyriar added this to the June 2016 milestone Jun 7, 2016
@Tyriar Tyriar self-assigned this Jun 7, 2016
@coreh
Copy link

coreh commented Jun 7, 2016

You can get the selection Range with document.getSelection().getRangeAt(0).

You could then extract the client rects that form it via: range.getClientRects(), and create a lot of absolutely positioned white divs of the right sizes with mix-blend-mode: difference;. That way they reverse whatever is below them.

Would also need to use pointer-events: none on the divs so that they don't affect the selection.

@Tyriar
Copy link
Member Author

Tyriar commented Jun 7, 2016

I've actually already done this as part of #7288

Using ::selection, I take the color and make it the selection background-color, then with the make the background-color the selection color. It turned out really nicely:

image

@coreh
Copy link

coreh commented Jun 7, 2016

Wow, that indeed looks way better than the current selection... Time for me to get on that Insiders build I guess haha. It's moving so fast! 👏

@Tyriar
Copy link
Member Author

Tyriar commented Jun 7, 2016

@coreh 😄 this will probably sit in PR for a day or 2 so land in insiders around the same time. But yeah, the daily insiders just started like an hour ago and already has some useful fixes in it.

@Tyriar
Copy link
Member Author

Tyriar commented Jun 13, 2016

Landed in insiders

@Tyriar Tyriar closed this as completed Jun 13, 2016
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accessibility Keyboard, mouse, ARIA, vision, screen readers (non-specific) issues feature-request Request for new features or functionality terminal General terminal issues that don't fall under another label
Projects
None yet
Development

No branches or pull requests

2 participants