3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-27 04:59:24 +01:00

launcher: set terminal title on launch (windows & posix)

This commit is contained in:
James Lu 2016-12-09 18:10:47 -08:00
parent b5f244009a
commit a2e0bb19dc

8
pylink
View File

@ -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: