You are not logged in.

#1 2015-07-17 14:04:02

Marcel-
Member
From: Utrecht, NL
Registered: 2006-12-03
Posts: 266

[SOLVED] Taskbar button doesn't update to window title with tmux

I'm running IceWM and recently using tmux within urxvt. I managed to set the window title from within tmux, which is updated correctly, only the taskbar button remains the same. Strangely enough, when I hover over the button, a tooltip displays the correct window name. All other applications I run, ranging from claws-mail to Eclipse, don't exhibit this behaviour.

How do I make IceWM update the taskbar button according to the window title?

EDIT: Changed subject, as this is not related to IceWM.

Last edited by Marcel- (2015-07-18 01:19:37)

Offline

#2 2015-07-17 14:50:23

Marcel-
Member
From: Utrecht, NL
Registered: 2006-12-03
Posts: 266

Re: [SOLVED] Taskbar button doesn't update to window title with tmux

I just remembered about xprop and it shows me

_ICEWM_TRAY(CARDINAL) = 0
_WIN_LAYER(CARDINAL) = 4
_NET_WM_DESKTOP(CARDINAL) = 0
_WIN_WORKSPACE(CARDINAL) = 0
WM_STATE(WM_STATE):
		window state: Normal
		icon window: 0x0
_NET_WM_STATE(ATOM) = 
_WIN_STATE(CARDINAL) = 0, 63
_NET_WM_PID(CARDINAL) = 8456
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW, _NET_WM_PING
WM_LOCALE_NAME(STRING) = "en_US.UTF-8"
WM_CLASS(STRING) = "urxvt", "URxvt"
WM_HINTS(WM_HINTS):
		Client accepts input or input focus: True
		Initial state is Normal State.
		window id # of group leader: 0xc00009
WM_NORMAL_HINTS(WM_SIZE_HINTS):
		user specified size: 600 by 624
		program specified minimum size: 6 by 12
		program specified resize increment: 6 by 12
		program specified base size: 0 by 0
		window gravity: NorthWest
WM_CLIENT_MACHINE(STRING) = "dc7800"
WM_COMMAND(STRING) = { "urxvt" }
_NET_WM_ICON_NAME(UTF8_STRING) = "mk@dc7800:~"
WM_ICON_NAME(STRING) = "mk@dc7800:~"
_NET_WM_NAME(UTF8_STRING) = "weechat 0.3.8"
WM_NAME(STRING) = "weechat 0.3.8"

So WM_ICON_NAME and WM_NAME differ.

Offline

#3 2015-07-17 14:59:37

Marcel-
Member
From: Utrecht, NL
Registered: 2006-12-03
Posts: 266

Re: [SOLVED] Taskbar button doesn't update to window title with tmux

Further tests reveal that xterm set those properties correctly, so it clearly is an rxvt-unicode issue.

Offline

#4 2015-07-17 16:05:45

Marcel-
Member
From: Utrecht, NL
Registered: 2006-12-03
Posts: 266

Re: [SOLVED] Taskbar button doesn't update to window title with tmux

On further investigation I noticed this in the source code of rxvt-unicode:

  switch (op)
    {
      case XTerm_name:
        set_title (str);
        /* FALLTHROUGH */
      case XTerm_iconName:
        set_icon_name (str);
        break;
      case XTerm_title:
        set_title (str);
        break;

(src/command.C l. 3350ff.)

Apparently the terminal code sent is XTerm_title, not XTerm_name. So it probably is a tmux issue after all. I'll investigate this further later today.

Offline

#5 2015-07-17 22:50:47

Marcel-
Member
From: Utrecht, NL
Registered: 2006-12-03
Posts: 266

Re: [SOLVED] Taskbar button doesn't update to window title with tmux

It's getting stranger now: when inserting set_icon_name(str) to the XTerm_title case, it shows that this is indeed related to the issue. However, when looking at the sources of tmux-git, I noticed that it actually sends \033]0;:

        /* On terminals with xterm titles (XT), fill in tsl and fsl. */
        if (tty_term_flag(term, TTYC_XT) &&
            !tty_term_has(term, TTYC_TSL) &&
            !tty_term_has(term, TTYC_FSL)) {
                code = &term->codes[TTYC_TSL];
                code->value.string = xstrdup("\033]0;");
                code->type = TTYCODE_STRING;
                code = &term->codes[TTYC_FSL];
                code->value.string = xstrdup("\007");
                code->type = TTYCODE_STRING;
        }

(tty-term.c l. 487ff.) This has been there since 2011.

As can be seen on TLDP, this escape sequence should set icon name and window title. However, one way or another, only the window title gets set.

Offline

#6 2015-07-18 01:19:23

Marcel-
Member
From: Utrecht, NL
Registered: 2006-12-03
Posts: 266

Re: [SOLVED] Taskbar button doesn't update to window title with tmux

In the mean time I asked about this in the tmux-users group, but I found the cause of the issue (and the discrepancy with xterm) myself: with the code in post #5, tmux checks if the terminal info has tsl and fsl defined. If it lacks both, tmux falls back to \033]0; as tsl. When looking at the output of infocmp from within xterm, I noticed that both are lacking.

However, when looking at the output of infocmp from within rxvt-unicode, I can see that tsl is set to \033]2;, so tmux uses that value. When I change the output of infocmp by removing both fsl and tsl and recompile that file using tic, both the window title and the icon name are set.

Offline

Board footer

Powered by FluxBB