Permalink
Browse files

Avoid escape characters when --nocolor

This fixes #123
  • Loading branch information...
1 parent 1b02424 commit 77e9347cf16a2cb08c7b79b40255b4700be81609 @dagwieers committed Nov 23, 2016
Showing with 5 additions and 3 deletions.
  1. +5 −3 dstat
View
8 dstat
@@ -2550,9 +2550,6 @@ def main():
user = getpass.getuser()
hostname = os.uname()[1]
- ### Disable line-wrapping (does not work ?)
- sys.stdout.write('\033[7l')
-
### Write term-title
if sys.stdout.isatty():
shell = os.getenv('XTERM_SHELL')
@@ -2608,10 +2605,15 @@ def main():
color[key] = ''
for key in theme:
theme[key] = ''
+ for key in ansi:
+ ansi[key] = ''
theme['colors_hi'] = (ansi['default'],)
theme['colors_lo'] = (ansi['default'],)
# print color['blackbg']
+ ### Disable line-wrapping (does not work ?)
+ sys.stdout.write(ansi['nolinewrap'])
+
if not op.update:
interval = op.delay

0 comments on commit 77e9347

Please sign in to comment.