-
Notifications
You must be signed in to change notification settings - Fork 202
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
Console buffer colors not drawn/restored properly (posterized heavily) #873
Comments
@HamRusTal |
To draw / restore console output we fist need to read / save console output. To not repeat myself, I refer you to these issues: Eventually an alternative solution was delivered: And used on our side: TL;DR: It allows saving and restoring arbitrary rectangles opaquely, without bothering with characters and color attributes. As mentioned above, you need relatively recent WT/OC binaries for this to work. The solution is not perfect:
But it is better than nothing. P.S.
This is what ReadConsoleOutput returns for that column:
Popups in Command Prompt are a special black magic (you can tell by the fact that they have their own color config in console settings). They work differently and are not exposed to third party apps like Far. |
@johnd0e Thank you, within @alabuzhev Thank you for the explanation (and for all your hard work on FAR!). I'll close the Issue as Won't Fix due to a Limitation of the platform. |
@alabuzhev Just on the subject of shadows, you may be able to achieve something like that with a DECCARA operation. That can be used to change the attributes of a cell without affecting the text. So to get a shadow similar to what I've seen in the Far Manager screenshots, you could set the background color to black, and apply a dim attribute to darken the foreground. I don't know if that's exactly the effect you're looking for, but it might be better than nothing. |
@j4james We try to draw 'real' shadows by merging both bg and fg with 50% transparent black: The 16-color fallback looks worse of course, but it's not the end of the world: The broken text in these areas is probably more pronounced: If we can keep the text intact it would definitely be better than nothing. |
OK, I don't think we can achieve anything quite as good as that with VT sequences as this point in time, because the dim attribute only applies to the foreground color. Technically there is a mode you can set (not yet implemented in Windows Terminal) that would make it apply to both foreground and background, but that also affects the bold/bright and the blink attributes, which is probably not a desired side effect.
Yeah, that part should definitely work. It won't be able to create a shadow through the middle of a DBCS character (I think it'll just apply the attributes to both halves), but it at least won't destroy the text. Btw, I forgot to mention that you'll likely need to change the DECSACE setting before using DECCARA, to get it to apply to a rectangular area rather than a "stream" selection. |
Far Manager version
3.0.6369.0 x86
OS version
10.0.19045.4894
Other software
Chafa:
chafa.exe
Steps to reproduce
Kusya.png
chafa.exe
to the same directory where the image is (or add it toPATH
).Kusya.png
andchafa.exe
; shrink panels vertically (or just hide them byCtrlO
).chafa.exe Kusya.png
, observe the output, run the same command again, observe the output.CtrlO
).F11
), cancel it (Esc
), observe the background regions affected by drawing the menu (their width depends on the “ClerType-friendly redraw” option in “Interface settings”).Expected behavior
Colors of the background are preserved as output, regardless of whether any FAR UI elements were ever drawn over them.
Actual behavior
In Step 4, the first image output is all posterized heavily, the second image is fine:
Reference image
After Step 6 (if taken), the regions affected by drawing the menu are posterized:
With ClearType-friendly redraw
After Step 7, the regions affected by drawing the panels are posterized:
Max damage
Note 1: the leftmost column of the affected full rows becomes black, unlike other white background cells.
Note 2: there's no such issue in the Command Prompt e.g. when calling and discarding the History menu (
F7
):With the menu still shown
The text was updated successfully, but these errors were encountered: