diff --git a/confluent_client/bin/confetty b/confluent_client/bin/confetty index cccaa45c..ef392d35 100755 --- a/confluent_client/bin/confetty +++ b/confluent_client/bin/confetty @@ -143,7 +143,7 @@ def updatestatus(stateinfo={}): info.append(time.strftime('%H:%M', time.localtime(showtime))) if info: status += ' [' + ','.join(info) + ']' - if os.environ['TERM'] not in ('linux'): + if os.environ.get('TERM', '') not in ('linux'): sys.stdout.write('\x1b]0;console: %s\x07' % status) sys.stdout.flush() @@ -175,7 +175,7 @@ def recurse_format(datum, levels=0): def prompt(): - if os.environ['TERM'] not in ('linux'): + if os.environ.get('TERM', '') not in ('linux'): sys.stdout.write('\x1b]0;confetty: %s\x07' % target) try: return raw_input(target + ' -> ') @@ -337,7 +337,7 @@ def do_command(command, server): return argv[0] = argv[0].lower() if argv[0] == 'exit': - if os.environ['TERM'] not in ('linux'): + if os.environ.get('TERM', '') not in ('linux'): sys.stdout.write('\x1b]0;\x07') sys.exit(0) elif argv[0] in ('help', '?'): @@ -583,7 +583,7 @@ def quitconfetty(code=0, fullexit=False, fixterm=True): # Request default color scheme, to undo potential weirdness of terminal sys.stdout.write('\x1b[m') if fullexit: - if os.environ['TERM'] not in ('linux'): + if os.environ.get('TERM', '') not in ('linux'): sys.stdout.write('\x1b]0;\x07') sys.exit(code) else: