Skip to content

Commit

Permalink
Fix to display stats on iterm2 terminal (#2440)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfevi authored and douglascamata committed Aug 3, 2016
1 parent 361c0fa commit 2f91fd0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,4 @@
* z4ppy.bbc
* matheussampaio
* Abraxas000
* lucasfevi
5 changes: 3 additions & 2 deletions pokemongo_bot/cell_workers/update_title_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 2f91fd0

Please sign in to comment.