2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-12-03 18:14:43 +00:00

Avoid trying to set title on incapable terminals

If running on a VC, for example, without benefit of tmux or anything, must suppress escape sequences.
This commit is contained in:
Jarrod Johnon 2014-10-06 16:51:56 -04:00
parent cf6c32b055
commit a907da0532
2 changed files with 6 additions and 3 deletions

3
TODO
View File

@ -61,4 +61,5 @@ AttributeError: 'str' object has no attribute 'iterkeys'
while it was trying to keep console open as much as possibl
-cs._handled_consoles[('n4', None)]._console.handle_data({'error':1}) is how I was able to
kick the session state back to working order after whatever event that was missed above
occurred.
occurred.
-save and restore the terminal title on startup/exit respectively

View File

@ -96,7 +96,8 @@ def updatestatus(stateinfo={}):
info.append(time.strftime('%H:%M', time.localtime(showtime)))
if info:
status += ' [' + ','.join(info) + ']'
sys.stdout.write('\x1b]0;console: %s\x07' % status)
if os.environ['TERM'] not in ('linux'):
sys.stdout.write('\x1b]0;console: %s\x07' % status)
sys.stdout.flush()
@ -127,7 +128,8 @@ def recurse_format(datum, levels=0):
def prompt():
sys.stdout.write('\x1b]0;confetty: %s\x07' % target)
if os.environ['TERM'] not in ('linux'):
sys.stdout.write('\x1b]0;confetty: %s\x07' % target)
try:
return raw_input(target + ' -> ')
except KeyboardInterrupt: