summary refs log tree commit diff
diff options
context:
space:
mode:
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2013-11-18 16:35:41 +0100
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2013-11-18 16:35:41 +0100
commitefd6c574a2cabc860f54018af726cd291cbec868 (patch)
treefc083deac0ab7fbf76b7521e03f55415ce415320
parent4113e6ab561e6f2f014fb2548d1c8691352b8304 (diff)
downloadyoutube-dl-efd6c574a2cabc860f54018af726cd291cbec868.tar.gz
youtube-dl-efd6c574a2cabc860f54018af726cd291cbec868.tar.xz
youtube-dl-efd6c574a2cabc860f54018af726cd291cbec868.zip
Correctly write and restore the console title on the stack (fixes #1782)
-rw-r--r--youtube_dl/YoutubeDL.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py
index 20eed96ca..fd5a30a0c 100644
--- a/youtube_dl/YoutubeDL.py
+++ b/youtube_dl/YoutubeDL.py
@@ -217,13 +217,15 @@ class YoutubeDL(object):
         if not self.params.get('consoletitle', False):
             return
         if 'TERM' in os.environ:
-            write_string(u'\033[22t', self._screen_file)
+            # Save the title on stack
+            write_string(u'\033[22;0t', self._screen_file)
 
     def restore_console_title(self):
         if not self.params.get('consoletitle', False):
             return
         if 'TERM' in os.environ:
-            write_string(u'\033[23t', self._screen_file)
+            # Restore the title from stack
+            write_string(u'\033[23;0t', self._screen_file)
 
     def __enter__(self):
         self.save_console_title()