From a2e0bb19dc4595c0cd1cee68032945a3cfeb4f65 Mon Sep 17 00:00:00 2001 From: James Lu Date: Fri, 9 Dec 2016 18:10:47 -0800 Subject: [PATCH] launcher: set terminal title on launch (windows & posix) --- pylink | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pylink b/pylink index 3cd08d1..b6aa935 100755 --- a/pylink +++ b/pylink @@ -36,6 +36,14 @@ if __name__ == '__main__': from pylinkirc import classes, utils, coremods log.info('PyLink %s starting...', __version__) + # Set terminal window title. See https://bbs.archlinux.org/viewtopic.php?id=85567 + # and https://stackoverflow.com/questions/7387276/ + if os.name == 'nt': + import ctypes + ctypes.windll.kernel32.SetConsoleTitleW("PyLink %s" % __version__) + elif os.name == 'posix': + sys.stdout.write("\x1b]2;PyLink %s\x07" % __version__) + # Check for a pid file, unless told not to, # this stops instance overlap, which wrecks clientbots if not args.no_check_pid: