Skip to content

Commit e1e3ca9

Browse files
committed
fix: Use self.term_window.hline() and curses.ACS_HLINE for the separator line
1 parent 413df02 commit e1e3ca9

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

glances/outputs/glances_curses.py

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -446,13 +446,24 @@ def separator_line(self, color='SEPARATOR'):
446446
self.line -= 1
447447
line_width = self.term_window.getmaxyx()[1] - self.column
448448
if self.line >= 0:
449-
self.term_window.addnstr(
450-
self.line,
451-
self.column,
452-
unicode_message('MEDIUM_LINE', self.args) * line_width,
453-
line_width,
454-
self.colors_list[color],
455-
)
449+
position = [self.line, self.column]
450+
line_color = self.colors_list[color]
451+
452+
if not self.args.disable_unicode:
453+
# Use curses.ACS_HLINE for the separator line
454+
self.term_window.hline(
455+
*position,
456+
curses.ACS_HLINE,
457+
line_width,
458+
line_color,
459+
)
460+
else:
461+
self.term_window.addnstr(
462+
*position,
463+
unicode_message('MEDIUM_LINE', self.args) * line_width,
464+
line_width,
465+
line_color,
466+
)
456467

457468
def __get_stat_display(self, stats, layer):
458469
"""Return a dict of dict with all the stats display.

0 commit comments

Comments
 (0)