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

Background colour messed up #25

Closed
gvanem opened this issue Apr 25, 2019 · 2 comments
Closed

Background colour messed up #25

gvanem opened this issue Apr 25, 2019 · 2 comments
Labels
bug Confirmed to be a bug windows Windows-specific

Comments

@gvanem
Copy link

gvanem commented Apr 25, 2019

When leaving termshark; the Yellow Do you want to quit dialogue box,
my console (CMD or 4NT) will look like this after 1 screen-ful of scroll up.

termcap-cmd

I assume a fix would be to save the B/F colours on program entry.
And restore those on program exit.

I'm on Win-10.

@gcla
Copy link
Owner

gcla commented May 5, 2019

Thanks. I don't yet know what causes this, and will investigate, but in the meantime, the background colors can be restored by running color at the cmd.exe prompt.

@pocc pocc added bug Confirmed to be a bug windows Windows-specific labels May 9, 2019
gcla added a commit to gcla/tcell that referenced this issue Jun 17, 2019
This change attempts to eliminate some lingering console issues when a windows
tcell application terminates. Here's a link to one such issue, in termshark:
gcla/termshark#25.

Rather than restoring the original console window settings, this change saves
the current console buffer, then creates and switches to a new console window
buffer, using CreateConsoleScreenBuffer and SetConsoleActiveScreenBuffer. The
Fini function restores the saved console buffer. This eliminates the
above-linked termshark issue, and has the side benefit of preserving the
existing console contents which are restored after the tcell application
terminates.

Tested on both cmd.exe and Windows Powershell.
@gcla
Copy link
Owner

gcla commented Jun 17, 2019

I've submitted a PR against tcell, the terminal-handling library that termshark uses: gdamore/tcell#288

@gcla gcla closed this as completed in 2165483 Jun 18, 2019
gcla added a commit to gcla/tcell that referenced this issue Nov 5, 2019
This change attempts to eliminate some lingering console issues when a windows
tcell application terminates. Here's a link to one such issue, in termshark:
gcla/termshark#25.

Rather than restoring the original console window settings, this change saves
the current console buffer, then creates and switches to a new console window
buffer, using CreateConsoleScreenBuffer and SetConsoleActiveScreenBuffer. The
Fini function restores the saved console buffer. This eliminates the
above-linked termshark issue, and has the side benefit of preserving the
existing console contents which are restored after the tcell application
terminates.

Tested on both cmd.exe and Windows Powershell.
gcla added a commit that referenced this issue Nov 5, 2019
These are used to address this issue: #25

The tcell PR discussion is here: gdamore/tcell#288.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed to be a bug windows Windows-specific
Projects
None yet
Development

No branches or pull requests

3 participants