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

Fix vertical lines in Putty with UTF-8 graphics #983

Merged
merged 1 commit into from
May 31, 2020

Conversation

proski
Copy link
Contributor

@proski proski commented Jan 13, 2020

Putty doesn't show VT100 line drawing characters in the UTF-8 mode by
default. Putty 0.70 and older doesn't even have that option.

For the vertical display separator, use '|' as background, then output
the vertical line character on every line.

For the line number separator, use draw_graphic() in the default mode
only. Use draw_chars() in the ASCII and UTF-8 modes.

Add a test for vertical lines. The display separator is always captured
as a line of '|' characters. The line number separators are captured
correctly. 'x' corresponds to ACS_VLINE.

Closes #981

@proski
Copy link
Contributor Author

proski commented Jan 15, 2020

Fixed an issue with the vertical window separator not redrawing correctly after cycling graphics modes with ~ on Ubuntu 14.04. Using a simple one-line approach to iterate over lines without using getmaxyx() ("it's better to ask forgiveness than permission").

@proski
Copy link
Contributor Author

proski commented Jan 16, 2020

  • Using switch without default. If a new graphics mode is used, the compiler would warn about a unhandled option, which is a good thing.
  • Made the line number separator code closer to the graph output code. ASCII and UTF-8 output strings, DEFAULT draws symbols.

@proski
Copy link
Contributor Author

proski commented Jan 16, 2020

  • In the line number separator code, return false for the unsupported graphics setting to fix a compiler error.
  • In the display separator code, use pipe (|) as background in the UTF-8 mode. It gets overwritten anyway, but the logic becomes simpler.

@proski
Copy link
Contributor Author

proski commented Jan 19, 2020

Added a test for vertical lines in all graphic modes. Unfortunately, the vertical display separator is always output as | symbols by save-display. However, the line number separators are captured correctly.

Putty doesn't show VT100 line drawing characters in the UTF-8 mode by
default. Putty 0.70 and older doesn't even have that option.

For the vertical display separator, output the vertical line character on
every line. Use wbkgdset() instead of wbkgd() as the code takes care of
setting the window contents.

For the line number separator, use draw_graphic() in the default mode
only. Use draw_chars() in the ASCII and UTF-8 modes.

Add a test for vertical lines. The display separator is always captured
as a line of '|' characters. The line number separators are captured
correctly. 'x' corresponds to ACS_VLINE.

Closes jonas#981
@proski
Copy link
Contributor Author

proski commented Jan 27, 2020

Changed redraw_display_separator() to be more uniform. The separator is now drawn in a loop in all graphic modes. wbkgd() is replaced with wbkgdset(), so the curses library can save some time clearing the window.

Using background to draw the separator is a nice trick, but it won't work in the UTF-8 mode without using cchar_t and introducing compatibility issues. It's better to do the same thing in all modes unless there are reasons to do it differently.

@jonas
Copy link
Owner

jonas commented May 31, 2020

Thanks a lot. Really great to have the test.

@jonas jonas merged commit 9aa42d1 into jonas:master May 31, 2020
@proski proski deleted the utf8-vline branch December 30, 2022 06:04
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.

Vertical window separator renders as "x" in Putty, but the graph is OK
2 participants