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

Terminal webgl renderer oh-my-posh prompt issues #120129

Closed
eamodio opened this issue Mar 29, 2021 · 21 comments
Closed

Terminal webgl renderer oh-my-posh prompt issues #120129

eamodio opened this issue Mar 29, 2021 · 21 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders terminal Integrated terminal issues terminal-rendering upstream Issue identified as 'upstream' component related (exists outside of VS Code) upstream-issue-fixed The underlying upstream issue has been fixed upstream-issue-linked This is an upstream issue that has been reported upstream verified Verification succeeded
Milestone

Comments

@eamodio
Copy link
Contributor

eamodio commented Mar 29, 2021

Below are 3 screenshots from vscode and windows terminal. You can see with the webgl renderer there are strange vertical lines that break the flow. And in both the webgl and canvas, the text isn't vertically aligned properly either. Whereas, Windows Terminal looks the best (only very minor vertical line artifacts).

VS Code webgl renderer

image

VS Code canvas renderer

image

Windows Terminal

image

@Tyriar
Copy link
Member

Tyriar commented Mar 29, 2021

What I suspect is happening here is that the more clever glyph boundary detection in the webgl renderer where we render the character with a margin and then find its bounding box is biting us because the darker lines are not exactly the same color as the actual background. I wonder if we should hardcode for these particular powerlines characters to explicitly drop that line.

@Tyriar Tyriar added bug Issue identified by VS Code Team member as probable bug terminal Integrated terminal issues terminal-rendering labels Mar 29, 2021
@Tyriar Tyriar added this to the Backlog milestone Mar 29, 2021
@Mellbourn
Copy link

Mellbourn commented Mar 31, 2021

I also experience problems with vertical lines that break the flow. This is on macOS Big Sur using a powerlevel10k prompt and Delugia Nerd Font Book (a variant of Cascadia Code with Nerd Fonts added)

VS Code GPU renderer
Delugia Nerd Font Book shown using GPU rendering

VS Code canvas renderer
Delugia Nerd Font Book shown using canvas rendering

iTerm2 terminal (which is also GPU based)
Delugia Nerd Font Book shown in iTerm2

I don't know if it is relevant but the issues adam7/delugia-code#53 and adam7/delugia-code#55 go into a lot of detail concerning vertical alignment.

@Tyriar
Copy link
Member

Tyriar commented Apr 1, 2021

In xterm.js demo

Dom:

dom

Canvas:

canvas

Webgl:

webgl

@Tyriar
Copy link
Member

Tyriar commented Apr 1, 2021

Upstream issue: xtermjs/xterm.js#3278

@Tyriar
Copy link
Member

Tyriar commented Apr 2, 2021

Fix looking good, should be in tomorrow's insiders xtermjs/xterm.js#3279, it also includes a vertical alignment improvement too

image

@Tyriar Tyriar added upstream Issue identified as 'upstream' component related (exists outside of VS Code) upstream-issue-linked This is an upstream issue that has been reported upstream upstream-issue-fixed The underlying upstream issue has been fixed labels Apr 2, 2021
@Tyriar Tyriar closed this as completed in cd4ef67 Apr 2, 2021
@Mellbourn
Copy link

Mellbourn commented Apr 2, 2021

It now looks perfect with GPU in Insiders!

Delugia Nerd Font Book shown using fixed GPU rendering

This is better than it ever was, even better than how canvas looked previously.

@Tyriar
Copy link
Member

Tyriar commented Apr 2, 2021

@Mellbourn good to hear 😃 the alignment is even fixed on canvas too so it should be just as good there as well if the user falls back to it (you can no longer set to use it explicitly).

@Mellbourn
Copy link

Mellbourn commented Apr 2, 2021

In Insiders, renderType is removed, so, as you say, you can't force it explicitly. If I set terminal.integrated.gpuAcceleration to off, I get this:

Delugia Nerd Font Book gpuAcceleration off

Here there is still a vertical line. Also, the double-width Nerd Fonts glyphs look cut off to single character width.

@Tyriar
Copy link
Member

Tyriar commented Apr 2, 2021

The DOM renderer works a little differently, to get cells to align perfectly they are laid our using inline-block and regular rely on the regular flow of the page as opposed to absolute positioning for performance reasons. I wonder if we could take the nerd font glyph ranges and the powerlines glyph ranges, and handle them specially. Positioning absolute won't work but I wonder if we could do some something using :before { content: '' } so that it could be positioned absolutely on top of the cell 🤔

Surprisingly I didn't see the line on my tests, maybe it's only on certain font sizes or something.

@Tyriar
Copy link
Member

Tyriar commented Apr 2, 2021

Created xtermjs/xterm.js#3287, I probably won't have time to check it out this release though.

@karesztrk
Copy link

Finally, its solved in Stable version as well ❤️ Thanks team

@floh96
Copy link

floh96 commented May 7, 2021

@Tyriar I'm on vscode insider commit 6bee0f2 and it looks broken again
Unbenannt
it worked on an older version (unfortunately I don't know the commit but it was a version witch was published shortly after this issue was fixed.

113411464-19bbc880-93b6-11eb-85cb-3cebfe5d36bf

@Tyriar
Copy link
Member

Tyriar commented May 7, 2021

@floh96 do you have a particular large window.zoomLevel/*.fontFamily and what's terminal.integrated.gpuAcceleration set to?

@floh96
Copy link

floh96 commented May 7, 2021

@Tyriar window.zoomLevel is 0, font family is 'CaskaydiaCove NF', Consolas, 'Courier New', monospace, font size is 16.
I only zoomed for the screenshot it looks the same with window.zoomLevel 0.
terminal.integrated.gpuAcceleration is set to auto.

@Tyriar
Copy link
Member

Tyriar commented May 7, 2021

@floh96 does the problem seem isolated to that font maybe?

@floh96
Copy link

floh96 commented May 7, 2021

@Tyriar i chanced the font to FiraMono NF same problem
Unbenannt

@floh96
Copy link

floh96 commented May 13, 2021

@Tyriar friendly ping 😄

@Tyriar
Copy link
Member

Tyriar commented May 13, 2021

@floh96 not sure what else we could do here unfortunately, without doing something drastic like not actually rendering the glyph but doing it ourselves like in xtermjs/xterm.js#2409

@floh96
Copy link

floh96 commented May 13, 2021

@Tyriar okay sad to hear.
it worked initially for me after the issue was closed so something musst have changed on vscode side.
is there a workaround (using a different renderer for example)?

@Tyriar
Copy link
Member

Tyriar commented May 13, 2021

@floh96 you could try switching up the gpuAcceleration setting as that drives which renderer is used, it's was fixed at least on my machine in all the renderers

@floh96
Copy link

floh96 commented May 13, 2021

@Tyriar thanks for your suggestion unfortunately changing the setting did not fix the issue.
I'm going to subscribe to xtermjs/xterm.js#2409

@github-actions github-actions bot locked and limited conversation to collaborators May 17, 2021
lemanschik pushed a commit to code-oss-dev/code that referenced this issue Nov 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders terminal Integrated terminal issues terminal-rendering upstream Issue identified as 'upstream' component related (exists outside of VS Code) upstream-issue-fixed The underlying upstream issue has been fixed upstream-issue-linked This is an upstream issue that has been reported upstream verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

7 participants
@eamodio @Mellbourn @Tyriar @lramos15 @karesztrk @floh96 and others