Ticket #4520 (new defect)

Opened 10 months ago

Last modified 10 months ago

Smell: alternate_plus_minus depends on xterm_title

Reported by: egmont Owned by:
Priority: minor Milestone: Future Releases
Component: mc-core Version: master
Keywords: Cc:
Blocked By: Blocking:
Branch state: no branch Votes for changeset:

Description

In src/filemanager/layout.c the code goes like:

void
update_xterm_title_path (void)
{
    if (mc_global.tty.xterm_flag && xterm_title)
    {
        [...]
        if (!mc_global.tty.alternate_plus_minus)
            numeric_keypad_mode ();
        [...]
    }
}

The features alternate_plus_minus and xterm_title have no reason to be related. They should be absolutely unrelated to each other. My preferred behavior of the +-* keys should be independent from my preference of the window title contents.

Yet, here some operation regarding the alternate_plus_minus mode is conditional to xterm having been detected and my xterm_title preference being enabled.

I have not tracked down the exact user-facing bug, but this is a very strong code smell. I'm pretty sure that if I disable xterm_title then something around the handling of alternate_plus_minus goes wrong. Or if not then the code there is absolutely unnecessary and misleading. Plus, the method name update_xterm_title_path does not accurately reflect what the method does.

Change History

comment:1 Changed 10 months ago by andrew_b

This was introduced in [ea5cfade553f113a0b13ccc0146854ec78198eaf]. Probably, this is not valid nowadays.

comment:2 Changed 10 months ago by zaytsev

It seems that putty is now available on Linux, so maybe check before removing?

https://wiki.ubuntuusers.de/PuTTY/

Note: See TracTickets for help on using tickets.