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

Linux/Mac - Text is hidden in "Text Alignment and Direction" scenario #1281

Closed
BDisp opened this issue May 3, 2021 · 6 comments
Closed

Linux/Mac - Text is hidden in "Text Alignment and Direction" scenario #1281

BDisp opened this issue May 3, 2021 · 6 comments

Comments

@BDisp
Copy link
Collaborator

BDisp commented May 3, 2021

Colors of the TextView and centered and justified Label are hiding the text in the "Text Alignment and Direction" scenario on Linux and Mac.

hiden-text

@BDisp BDisp changed the title Colors of the TextView and centered and justified Label are hiding the text in the "Text Alignment and Direction" scenario. Colors of the TextView and centered and justified Label are hiding the text in the "Text Alignment and Direction" scenario on Linux and Mac May 3, 2021
@tig tig changed the title Colors of the TextView and centered and justified Label are hiding the text in the "Text Alignment and Direction" scenario on Linux and Mac Linux/Mac - Text is hidden in "Text Alignment and Direction" scenario on Linux and Mac May 3, 2021
@tig tig changed the title Linux/Mac - Text is hidden in "Text Alignment and Direction" scenario on Linux and Mac Linux/Mac - Text is hidden in "Text Alignment and Direction" scenario May 3, 2021
@tig
Copy link
Collaborator

tig commented May 3, 2021

I edited the bug title and description to make the title more terse. It is hard to process bug lists with long/wordy titles.

@BDisp
Copy link
Collaborator Author

BDisp commented May 3, 2021

The main problem is because of this:

var color1 = new ColorScheme { Normal = Application.Driver.MakeAttribute (Color.Black, Color.Gray) };
var color2 = new ColorScheme { Normal = Application.Driver.MakeAttribute (Color.Black, Color.DarkGray) };

Unix don't have a DarkGray but only a COLOR_CYAN. So, Gray and Dark Gray is the same color for the Unix.

@BDisp
Copy link
Collaborator Author

BDisp commented May 5, 2021

I made a basic color scenario and I found that there is a large bug in color management in the CursesDriver. Whenever I leave and re-enter the scenario, the colors are shown in a randomly and uncontrolled way.
Because of this I think that after all it can be possible to stop and restart the driver, as you wanted to do at the beginning @tig, and maybe not only a singleton.

curses-color-bug

BDisp added a commit to BDisp/Terminal.Gui that referenced this issue May 5, 2021
@BDisp
Copy link
Collaborator Author

BDisp commented May 6, 2021

Another repro related with the CursesDriver color issue. While doing a tabbing (in this case with Ctrl+PageDown using my PR #1266) the masked text colors are always changed.

curses-color-bug2

@tznind
Copy link
Collaborator

tznind commented May 6, 2021

I have noticed this issue in the past (many months ago). I thought maybe it was to do with the color (Attribute) structs going out of scope and getting garbage collected (despite there being references to them). Which doesn't make much sense but it was my best guess. I think in the end I did some workaround that involved constantly redeclaring colors or declaring them at the top of my program (can't quite remember).

It does seem to take a while to kick in like you can see that it holds the (red) color for a while then looses it.

@BDisp
Copy link
Collaborator Author

BDisp commented May 6, 2021

I'm glad I could have fixed this annoying bug.

@tig tig closed this as completed in 4af4839 May 6, 2021
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

No branches or pull requests

3 participants