# HG changeset patch # User drewp@bigasterisk.com # Date 2023-06-04 01:30:58 # Node ID e38429c283bc2c95ebf21fcc41fbf0a1829ac0e0 # Parent 8fc5da2216882b4c8182d703e97c61a944d3d54b make service namaes more visible in terminal titles diff --git a/light9/run_local.py b/light9/run_local.py --- a/light9/run_local.py +++ b/light9/run_local.py @@ -1,5 +1,6 @@ # bootstrap +import re import logging import os import socket @@ -45,6 +46,10 @@ coloredlogs.install( def setTerminalTitle(s): if os.environ.get('TERM', '') in ['xterm', 'rxvt', 'rxvt-unicode-256color']: + m = re.search(r'(light9\..*):', s) + if m is not None: + s = m.group(1) + s = s.replace('/home/drewp/own/proj/','') print("\033]0;%s\007" % s) # not escaped/protected correctly hue = (hash(progName) % 255) / 255 r, g, b = [int(x * 255) for x in hsv_to_rgb(hue, s=.2, v=.1)]