Move to 'block' characters for bar graph display#14
Open
lelandbatey wants to merge 1 commit into
Open
Conversation
This change modifies the characters used to display the "progressbars" of the graph. Instead of being purely ascii characters such as `#`, `|`, and `.`, it uses longer 'block elements' characters `█`, `▟`, and `▗`, respectively. On terminals which support it, this makes for a much improved visual display. This is accomplished by swapping the characters being printed, then by changing the program/build system slightly so that it will link against `ncursesw` (the version of ncurses which supports full-width characters instead of only purely ascii). Since this change would permanently shift this entire codebase so that it uses ncursesw instead of "classic ncurses", and since it would _force_ the use of multiwidth 'block' characters which may not be compatible with many of the original terminals where nload is used, I don't recommend upstreaming this change to nload, at least not until someone makes further changes which make this a toggle-able setting and which maintains total backwards compatibility with systems where ncursesw isn't available. Until then, this change will exist as an option for those who want it (like me), and as an example for the interested.
Author
|
@perguth No, it's not displaying correctly. The strange offsets come from how Github displays the text in the browser. If you open that text in your terminal, it looks like this: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


This change modifies the characters used to display the "progressbars"
of the graph. Instead of being purely ascii characters such as
#,|,and
., it uses longer 'block elements' characters█,▟, and▗,respectively. On terminals which support it, this makes for a much
improved visual display.
Here's an example of the bar-graph output with this change:
This is accomplished by swapping the characters being printed, then by
changing the program/build system slightly so that it will link against
ncursesw(the version of ncurses which supports full-width charactersinstead of only purely ascii).
Since this change would permanently shift this entire codebase so that
it uses ncursesw instead of "classic ncurses", and since it would
force the use of multiwidth 'block' characters which may not be
compatible with many of the original terminals where nload is used, I
don't recommend upstreaming this change to nload, at least not until
someone makes further changes which make this a toggle-able setting and
which maintains total backwards compatibility with systems where
ncursesw isn't available.
Until then, this change will exist as an option for those who want it
(like me), and as an example for the interested.