shorten lengthy terminal titles

This commit is contained in:
woorst
2016-07-01 02:02:27 -05:00
parent aa27647f59
commit b489cafa0b

View File

@@ -284,7 +284,12 @@ class Page(object):
self.term.add_line(window, sub_name, 0, 0) self.term.add_line(window, sub_name, 0, 0)
# Set the terminal title # Set the terminal title
title = sub_name + ' - rtv {0}'.format(__version__) if len(sub_name) > 50:
title = sub_name.strip('/').rsplit('/', 1)[1].replace('_', ' ')
else:
title = sub_name
title = title + ' - rtv {0}'.format(__version__)
sys.stdout.write('\x1b]2;{0}\x07'.format(title)) sys.stdout.write('\x1b]2;{0}\x07'.format(title))
sys.stdout.flush() sys.stdout.flush()