Ticket #1769 (new defect)
ncurses screen library: no ctrl/shift-key recognized
Reported by: | gotar | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | Future Releases |
Component: | mc-tty | Version: | 4.7.0-pre4 |
Keywords: | Cc: | anton.bugs@…, dickey | |
Blocked By: | Blocking: | ||
Branch state: | no branch | Votes for changeset: |
Description
When compiled with ncurses(w) ctrl/shift-keys (like arrows in editor) are not recognized at all.
Change History
comment:2 Changed 15 years ago by E.L.K.
It seems i found the solution for this problem. I'm not sure that this is "right" solution, but it works, and maybe will be useful in diagnosing source of it.
Described here: http://7ocb.blogspot.com/2010/03/screen-midnight-commander-shift-f6.html
comment:4 Changed 15 years ago by gotar
- Priority changed from major to minor
anton_kg, E.L.K.: no, you are talking about something entirely different; your shifts ARE recognized (which is obvious as some behaviour changes), but misinterpreted (see #367). This is caused by using different shift-Fx 'wrap' policy: one is to max out the range (F1-12 shifted == F13-24), the other is to be natural for humans (i.e. in terms of decimal shift: F1-12 shifted == F11-F22, thus doubling F11==shift-F1 and F12==shift-F2). You can go to Options->Learn keys and teach mc to treat F18 (this is what you get as input) as 'Function key 16'.
angel_il: my TERM is plain xterm. When I hit shift-F1 to F10 under mc/ncurses (either in command line or mcedit) i got this: 2P2Q2R2S28~29~31~32~33~34~. I can teach mc to recognize these:
[terminal:xterm]
f13=
eO2R
but there's no place to teach it that ^[[1;2A is shift-up. With slang as screen library the same sequences ARE recognized well. I suspect that ncurses uses only terminfo database, which doesn't contain such combos.
I've just checked 4.7.1 and nothing has changed. But the main question is: what's the point of using/having this screen library at all? Why/when slang is not superior?
comment:5 Changed 13 years ago by andrew_b
- Branch state set to no branch
- Milestone changed from 4.7 to Future Releases
comment:6 Changed 17 months ago by ossi
- Cc dickey added
what's the point of using/having this screen library at all? Why/when slang is [] superior?
that's actually a good question.
ncurses is theoretically a cleaner solution, because it doesn't come bundled with a scripting language interpreter.
but issues like this (and #2837), #4096, and #4144 call this into question.
so given that clearly nobody is fixing this, it may be more pragmatic to simply commit to slang after all, and actually leverage that interpreter (#4187).
comment:7 Changed 17 months ago by zaytsev
so given that clearly nobody is fixing this, it may be more pragmatic to simply commit to slang after all, and actually leverage that interpreter (#4187)
I have no strong opinion about committing (or not committing) to slang, but the interpreter... oh my dear god. I wish somebody would just employ me full time to work on mc some, so that I could resurrect the brilliant mooffie's work - solid architecture and professional implementation, good choice of tools, excellent documentation. Really, a fantastic piece of work!
I'm experiencing about the same issue with 4.7 release. The shift key is not recognized with ncurces then I want to rename a file, for example. Shift+F6 press is actually trying to delete a file.