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

Support opaque selections in DOM renderer #3839

Merged
merged 2 commits into from May 27, 2022
Merged

Conversation

Tyriar
Copy link
Member

@Tyriar Tyriar commented May 27, 2022

Brings the DOM renderer closer to the webgl renderer which draws the text
on top of the selection. This is done by leveraging the override system
similar to in webgl and as well as forcing the element above the selection.
This also improves contrast color caching for the DOM renderer.

This should result in a slight performance hit but only when a selection
is being made. The improved contrast seems worth it.

Fixes #3838


term.setOption('rendererType', 'dom');
term.setOption('minimumContrastRatio', 5);
term.setOption('theme', {
    selection: '#ffffff',
    selectionForeground: '#000000'
});

Before:

image

After:

image


Using this to show minimum contrast ratio is working:

term.setOption('rendererType', 'dom');
term.setOption('minimumContrastRatio', 5);
term.setOption('theme', {
    selection: '#ff0000',
    foreground: '#ff1111'
});

image

Brings the DOM renderer closer to the webgl renderer which draws the text
on top of the selection. This is done by leveraging the override system
similar to in webgl and as well as forcing the element above the selection.
This also improves contrast color caching for the DOM renderer.

This should result in a slight performance hit but only when a selection
is being made. The improved contrast seems worth it.

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

Successfully merging this pull request may close these issues.

Unexpected selectionForeground results on DOM renderer
1 participant