-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to redefine tab key action #TAB #3672
Comments
|
|
Also, similar qustions asked a couple of times in stackexchange/overflow and discussed a lot of times in different help forums, so many people stuck on that. This problem repels many new users out of using MC. |
Branch: 3672_bind_tab |
I haven't tested the patch, but the code looks fine.
(I guess you've investigated the possibility of putting the TAB key on the dialog_map keymap and deemed it problematic for some reason.)
Here's an idea for improvement (though I haven't thought about it much; it might be flawed):
If CK_ChangePanel returned MSG_NOT_HANDLED when there's only one panel shown (as in the case of the "Long file list" listing mode), then the TAB will be sent next the to command-line (see sequence diagram). This would let users use TAB to switch panels normally, but to auto-complete when only one panel is shown.
Other random notes, which you can ignore:
|
Replying to zaytsev:
A little history:
Many years ago I used sequence diagrams to help me study some system. The tool I used for drawing was sdedit, which draws the diagram for you based on a textual description you give it. Unfortunately, its language is horrible for humans (IMHO), so I ended up writing a Ruby "DSL" that, given a less horrible syntax, produces input for sdedit. That's how I generated that diagram. I'd imagine that nowadays there exist nicer tools/languages for doing this. |
Ah, I see; thank you for the clarification. In that case, it's not programmatic in a sense that you have to write the DSL yourself, instead of some source code analyzer. That's what I was interested in... |
Replying to mooffie:
Yes, I tried in many ways (using mc.keymap in user's home dir and also global mc.keymap file in /etc/mc). My settings just ignored/overwritten.
I like this idea as last resort case, I don't think this is the best idea because one key must do same action no matter how many pannels in screen, thats a good practice for any UI. Users will get used to press TAB for some action being in one panel view mode and will be confused trying to make same action in another view.
The bad thing here is that you will be unable to switch if command line is not empty (like in case if you want to put to cmd string some file name from other panel).
Generally, it should be possibly to redefine TAB for autocomplete action and TAB+something for panel switch. Alternatively it also will be useful to make some checkbox for inverting ESC-TAB (M-TAB) with TAB (so ESC-TAB will switch and TAB will autocomplete) - it is easy for configuration and hotkeys will act evenly in any cases. May be last solution is even better than making option for arbitrary redefinition, at least I use panel switching quite rarely and wont be annoyed to press two keys to switch (like now when I annoyed of having to press two key for autocompletion). |
|
|
Replying to andrew_b: |
Replying to Argon:
You can try a one of nightly builds.
The next release will be after a long time (several months). |
Hi, please note that
will autocomplete on the command line, but not on text fields in dialog windows (e.g. copy file, etc).
Is it possible to have Complete = tab also for dialog windows? I tried putting it in the [dialog] section of my mc.keymap file but it doesn't work.
So far, I'm using this suboptimal workaround:
... so I get tab completion on the command line, and old-style esc-tab completion on text dialog fields. |
Replying to cri:
File name completion via alt (or esc)-tab works fine for me in the copy/move dialog, in the "Save as" dialog in mcedit, etc.
Complete what? Each input line has its own specific stuff: file names, words, etc. For example, the file name completion for "Content" field of "Find file" dialog in pointless. |
Replying to andrew_b:
Indeed, my message was about completion via tab (after setting Complete = tab), not via alt/esc-tab.
Nothing new, I meant to have the same completions that are available now on each input line, only using tab instead of alt/esc-tab.
(and to be able to define another key, instead of tab, to move across fields) |
Replying to cri:
Unfortunately, Tab and Shift-Tab keys are hardcoded to switch current widget in a dialog. |
Replying to andrew_b:
Well I guess the problem is "how hard" they are hard-coded :)
...but I can't judge that, or even come up with patches, so I'll just repeat my suggestion: now that we are able to redefine tab for completion on the command line, it would be really nice to have the same behavior also on widget text fields. |
Reopening, because the support for redefining tab action introduced with this ticket got broken in mc 4.8.26.
More specifically, in ~/.config/mc/mc.keymap:
So the tab key seems to be hardwired again to only change panels, it's not possible anymore to use it for command completion.
Looking at https://midnight-commander.org/wiki/NEWS-4.8.26 initially I thought that the fix in #4107 could have introduced the regression, but I tried rebuilding 4.8.26 without that fix and the support is still broken.
The other tab-related fix mentioned in NEWS-4.8.26 is #2269; so maybe the regression was introduced by that fix, or/and by some other changes occurred between 4.8.25 (which works OK) and 4.8.26. Any help?
Another (maybe related?) minor issue: assigning ChangePanel = ctrl-tab has never worked for me (only shift-tab worked); it would be nice to be able to use ctrl-tab to change panels (i.e. the same keys used to change tabs in web browser windows). Maybe this can be fixed while debugging the main problem described above? Otherwise I'll open a different ticket for this. |
|
Replying to cri:
[main] was renamed to [filemanager]: [1869dff]. Sorry, this change is missed in NEWS-4.8.26. |
Replying to andrew_b:
Ouch, I missed that too when diffing old/new config files. Thanks!
Re the ctrl-tab problem I mentioned above, actually it's just a small quirk: ChangePanel = ctrl-tab for switching panels usually works fine, with one exception: if I run mc after becoming root via su -, it stops working: ctrl-tab behaves just like tab.
Some more tests I did:
I'm not even sure this is a midnight commander bug (so I guess you can close this ticket): a quick googling reveals that ctrl-tab is often problematic in X for some applications and/or terminal emulators, and there are all sorts of suggested fixes that involve hacking ~./Xresources, xmodmap etc to get ctrl-tab working properly, but I eventually gave up.
I'm using the following workaround instead: ChangePanel = ctrl-tab; shift-tab, so when ctrl-tab doesn't work, I can use shift-tab. |
Ok. |
Important
This issue was migrated from Trac:
Argon
(xxxargonxxx@….com)xxxargonxxx@….com
,zaytsev
(@zyv),cri@….org
TAB
,autocompletion
,keybinding
I searched like 5 hours for any way to redefine default action assigned to TAB key (to not switch between panels so to be able to use it for autocompletion). I looked over all mc.keymap config files, but it doesnt contain such setting. I checked man mc, internal mc help utility and this website wiki. No information at all. Is it possible at least?
This issue adressed to problem with TAB key action rebinding (it needs to be possible to trigger autocompletion on TAB key) AND providing any information if it is:
a) possible (so, how?);
b) not possible (this should be covered in man pages, help topics and wiki as well, as special remark)
The text was updated successfully, but these errors were encountered: