Ticket #2676 (closed defect: fixed)
mc-4.8.0-56-g16d1abf: save of some learned keys is broken
Reported by: | bircoph | Owned by: | angel_il |
---|---|---|---|
Priority: | major | Milestone: | 4.8.1 |
Component: | mc-config-ini | Version: | master |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Branch state: | merged | Votes for changeset: | committed-master committed-stable |
Description
Hello,
recent git snapshot brokes key binding saving.
Midnight Commander was build as follows:
GNU Midnight Commander 4.8.0-56-g16d1abf Built with GLib 2.30.1 Using the S-Lang library with terminfo database With builtin Editor With subshell support as default With support for background operations With mouse support on xterm With support for X11 events With internationalization support With multiple codepages support Virtual File Systems: cpiofs, tarfs, sfs, extfs, ftpfs, fish Data types: char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64;
I use xterm + screen + mc.
For 13 <= n <=20 Fn keys I map Fn as S-F(n-10) (e.g. F13 as Shift-F3), this results in the following keymap on the old mc (4.8.0-pre1):
[terminal:screen] f13=\\e[1\;2R f14=\\e[1\;2S f15=\\e[15\;2~ f16=\\e[17\;2~ f17=\\e[18\;2~ f18=\\e[19\;2~ f19=\\e[20\;2~ f20=\\e[21\;2~
Please note, that this keymap loads well with both new and old mc versions.
But new mc snapshot saves these keys as follows:
[terminal:screen] f13=\\e[1\\;2R f14=\\e[1\\;2S f15=\\e[15\\;2~ f16=\\e[17\\;2~ f17=\\e[18\\;2~ f18=\\e[19\\;2~ f19=\\e[20\\;2~ f20=\\e[21\\;2~
It inserts extra \ before ; and fails to load its own config, which results in badly broken key binding for affected keys.
Attachments
Change History
comment:2 Changed 13 years ago by bircoph
commit b375236b536e341530e14bcb287da6566d586732 causes this problem
comment:3 Changed 13 years ago by bircoph
Reverting changes in lib/mcconfig/set.c and src/learn.c from this commit fixes my problem, but reopens bug #2544.
I do not know how to fix them both, but b375236b536e341530e14bcb287da6566d586732 is definitely not a proper fix.
comment:4 Changed 13 years ago by bircoph
The following patch fixes the bug by adding special function to set raw value, but not a raw string. It looks like current function can't handle both search string and escaped key bindings, so new function is added to aid keybindnigs.
Patch is attached. OK to apply?
comment:6 Changed 13 years ago by angel_il
- Owner set to angel_il
- Status changed from new to accepted
- Milestone changed from Future Releases to 4.8.1
comment:7 Changed 13 years ago by angel_il
- Votes for changeset set to angel_il
- Branch state changed from no branch to on review
branch: 2676_learn_f13-f20_fix (parent: master)
please review
comment:8 Changed 13 years ago by andrew_b
- Keywords stable-candidate added
- Votes for changeset changed from angel_il to angel_il andrew_b
- Branch state changed from on review to approved
comment:9 Changed 13 years ago by angel_il
- Status changed from accepted to testing
- Votes for changeset changed from angel_il andrew_b to committed-master
- Resolution set to fixed
- Branch state changed from approved to merged
comment:10 Changed 13 years ago by andrew_b
- Keywords stable-candidate removed
- Status changed from testing to closed
- Votes for changeset changed from committed-master to committed-master committed-stable
Cherry-picked to 4.7.5-stable.
changeset:85ff690d36c8ec72fa1f4da9e189cf9fb3f47efc
Good 4.8.0-pre1 was indeed some other git commit (though mc -V doesn't report which one).
Git tag 4.8.0-pre1 is also broken, good version is 4.7.5.1. I'll try to bisect the bug.