added program title to terminal title

This commit is contained in:
Tobin
2015-04-02 01:46:46 -05:00
parent dd1aa1bd4f
commit 943bc34fbf

View File

@@ -15,6 +15,7 @@ from .curses_helpers import curses_session
from .submission import SubmissionPage
from .subreddit import SubredditPage
from .docs import *
from .__version__ import __version__
__all__ = []
@@ -68,6 +69,13 @@ def main():
args = command_line()
local_config = load_config()
# set the terminal title
title = 'rtv {0}'.format(__version__)
try:
sys.stdout.write("\x1b]2;{0}\x07".format(title))
except:
os.system(title)
# Fill in empty arguments with config file values. Paramaters explicitly
# typed on the command line will take priority over config file params.
for key, val in local_config.items():