From 2f91fd0410eeda430aeb9cb956885eda8bf04e22 Mon Sep 17 00:00:00 2001 From: Lucas Vieira Date: Wed, 3 Aug 2016 09:21:56 -0500 Subject: [PATCH] Fix to display stats on iterm2 terminal (#2440) --- CONTRIBUTORS.md | 1 + pokemongo_bot/cell_workers/update_title_stats.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index bd7894f0c2..dfd8a24af2 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -50,3 +50,4 @@ * z4ppy.bbc * matheussampaio * Abraxas000 + * lucasfevi diff --git a/pokemongo_bot/cell_workers/update_title_stats.py b/pokemongo_bot/cell_workers/update_title_stats.py index d255834870..911d2efd4d 100644 --- a/pokemongo_bot/cell_workers/update_title_stats.py +++ b/pokemongo_bot/cell_workers/update_title_stats.py @@ -6,7 +6,6 @@ from pokemongo_bot.worker_result import WorkerResult from pokemongo_bot.tree_config_builder import ConfigException - class UpdateTitleStats(BaseTask): """ Periodically updates the terminal title to display stats about the bot. @@ -108,8 +107,10 @@ def _update_title(self, title, platform): :raise: RuntimeError: When the given platform isn't supported. """ if platform == "linux" or platform == "linux2"\ - or platform == "darwin" or platform == "cygwin": + or platform == "cygwin": stdout.write("\x1b]2;{}\x07".format(title)) + elif platform == "darwin": + stdout.write("\033]0;{}\007".format(title)) elif platform == "win32": ctypes.windll.kernel32.SetConsoleTitleA(title) else: