Skip to content

Commit e086625

Browse files
authored
Merge pull request nicolargo#2877 from Neved4/medium-line
fix: Use `ncurses` dedicated functions for the separator line
2 parents 413df02 + bfdf899 commit e086625

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

glances/outputs/glances_curses.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -446,12 +446,15 @@ 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,
449+
position = [self.line, self.column]
450+
line_color = self.colors_list[color]
451+
line_type = curses.ACS_HLINE if not self.args.disable_unicode else unicode_message('MEDIUM_LINE', self.args)
452+
453+
self.term_window.hline(
454+
*position,
455+
line_type,
453456
line_width,
454-
self.colors_list[color],
457+
line_color,
455458
)
456459

457460
def __get_stat_display(self, stats, layer):

0 commit comments

Comments
 (0)