Skip to content

Learn keys: Does not escape properly when saving #5049

@egmontkob

Description

@egmontkob

Is there an existing issue for this?

  • I have searched the existing issues

Midnight Commander version and build configuration

4.8.33, git

Operating system

.

Is this issue reproducible using the latest version of Midnight Commander?

  • I confirm the issue is still reproducible with the latest version of Midnight Commander

How to reproduce

The bindings of escape sequences are read from the global mc.lib and local ini.

They undergo two levels of unescaping. First, GLib's KeyFile unescapes \\e (three bytes) to \e (two bytes), and \; to \.

Then our code unescapes \e (two bytes) to the escape byte, and ^X (two bytes) to the Ctrl-X byte.

When saving the entries, our own unescaping doesn't have an escaping counterpart.

A sequence ending in ^, e.g. urxvt's Ctrl+Fn, ends up being stored in the file ending in a single ^, which, when read back, is dropped as an incomplete sequence.

See also #5048: using KeyFile's get/set_value() we could probably flatten this to a single layer of escaping/unescaping.

Expected behavior

.

Actual behavior

.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: configConfiguration INI filesprio: lowMinor problem or easily worked aroundres: invalidThe ticket is not a bug, or is a support request

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions