diff --git a/rtv/page.py b/rtv/page.py index fbbbf66..a1877e6 100644 --- a/rtv/page.py +++ b/rtv/page.py @@ -11,6 +11,7 @@ from kitchen.text.display import textual_width from . import docs from .objects import Controller, Color, Command from .exceptions import TemporaryFileError +from .__version__ import __version__ def logged_in(f): @@ -282,6 +283,11 @@ class Page(object): sub_name = self.content.name.replace('/r/front', 'Front Page') self.term.add_line(window, sub_name, 0, 0) + # Set the terminal title + title = sub_name + ' - rtv {0}'.format(__version__) + sys.stdout.write('\x1b]2;{0}\x07'.format(title)) + sys.stdout.flush() + if self.reddit.user is not None: # The starting position of the name depends on if we're converting # to ascii or not @@ -415,4 +421,4 @@ class Page(object): n_rows, _ = window.getmaxyx() for row in range(n_rows): - window.chgat(row, 0, 1, attribute) \ No newline at end of file + window.chgat(row, 0, 1, attribute)