Skip to content

mc should use kPRV5 from terminfo for Ctrl+PageUp #4512

Description

@mc-butler

Important

This issue was migrated from Trac:

Origin https://midnight-commander.org/ticket/4512
Reporter CyberShadow (thecybershadow@….com)

I noticed that the Ctrl+PageUp combination (to navigate to the parent directory) didn't work in wezterm (with config.term = "wezterm"). A bit of experimentation showed that it worked when wezterm identified itself as xterm, or if mc is started with --xterm. Upon investigating, I found that the reason why it works with TERM=xterm is only because mc itself hard-codes the sequence that xterm uses (the xterm_key_defines array), when it detects that it is running in that terminal emulator (check in init_key) or with --xterm.

I am not sure if this is standardized anywhere, but I noticed that many terminal emulators declare the sequence for Ctrl+PageUp as the kPRV5 capability in their terminfo. Grepping for kPRV5 in my /usr/share/terminfo gives me over 60 matches. wezterm's terminfo doesn't have it yet, but it would not be a problem to add it.

I think it would be nice if mc checked terminfo for capability strings such as kPRV5, in order to support such key combinations in other terminals.

I can work on a patch with some guidance. I noticed the Key_xxx definitions in keyxdef.c, but it's not clear to me how to extend that to only teach mc about some new terminfo keys.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: ttyInteraction with the terminal, screen librariesprio: mediumHas the potential to affect progress

    Fields

    No fields configured for Feature.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions