Skip to content

Commit

Permalink
Fixes #102 = Default to --nocolor when stdout isn't a tty
Browse files Browse the repository at this point in the history
  • Loading branch information
dhylands committed May 24, 2019
1 parent 1277d1d commit 6028e96
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion rshell/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2672,6 +2672,8 @@ def real_main():
default_user = os.getenv('RSHELL_USER') or 'micro'
default_password = os.getenv('RSHELL_PASSWORD') or 'python'
default_editor = os.getenv('RSHELL_EDITOR') or os.getenv('VISUAL') or os.getenv('EDITOR') or 'vi'
default_color = sys.stdout.isatty()
default_nocolor = not default_color
global BUFFER_SIZE
try:
default_buffer_size = int(os.getenv('RSHELL_BUFFER_SIZE'))
Expand Down Expand Up @@ -2754,7 +2756,7 @@ def real_main():
dest="nocolor",
action="store_true",
help="Turn off colorized output",
default=False
default=default_nocolor
)
parser.add_argument(
"-l", "--list",
Expand Down

0 comments on commit 6028e96

Please sign in to comment.