Skip to content

Commit 8d3f917

Browse files
committed
Use correct ANSI control sequence compatible with watch (wookayin#32)
In some environments (Ubuntu 17.10), the control character sequence for resetting colors/attributes (sgr0) can't be recognized in watch command. As a result, an additional character may be shown. Using different termstr seems to resolve this issue, in that `term.normal` returns a compatible control sequence.
1 parent 0b40990 commit 8d3f917

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

gpustat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ def print_formatted(self, fp=sys.stdout, force_color=False, no_color=False,
385385
raise ValueError("--color and --no_color can't be used at the same time")
386386

387387
if force_color:
388-
t_color = Terminal(kind='linux', force_styling=True)
388+
t_color = Terminal(kind='xterm-color', force_styling=True)
389389
elif no_color:
390390
t_color = Terminal(force_styling=None)
391391
else:

0 commit comments

Comments
 (0)