diff options
Diffstat (limited to 'weechat/python/micmot.py')
-rw-r--r-- | weechat/python/micmot.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/weechat/python/micmot.py b/weechat/python/micmot.py index e1a77b3..d6965b1 100644 --- a/weechat/python/micmot.py +++ b/weechat/python/micmot.py @@ -16,12 +16,13 @@ import os import re -import weechat +import weechat # type: ignore TMUX_FIFO = os.environ.get('WEECHAT_TMUX_FIFO', os.environ['HOME'] + '/.weechat/micmot-fifo') PANE_NAME = os.environ.get('WEECHAT_TMUX_PANE', 'weechat') +PANE_MAXLEN = 30 weechat.register( "micmot", @@ -68,7 +69,8 @@ def hotlist_cb(a, b, c): .format(buffer_name, plugin_name)) if tmux: - set_pane_name("[{}]".format(re.sub(r'[^.,#0-9A-Za-z-]+', '', tmux))) + set_pane_name("[{}]".format( + re.sub(r'[^.,#0-9A-Za-z-]+', '', tmux[:PANE_MAXLEN]))) highlight_pane() else: set_pane_name(PANE_NAME) |