Menu

How to Use TAB to Auto Complete Directory on Midnight Commander for Windows

cricrazy
2022-03-03
2022-03-15
  • cricrazy

    cricrazy - 2022-03-03

    Since Tab key is already assigned to switch panels. I cannot use TAB key to auto complete for directory when I do cd c:\users\...

    I looked around, there may be a way to edit keymap or config file, but I don't know how to do that, and most help out there is for Linux.

    Can someone help, please? Thanks.

     
  • adamy

    adamy - 2022-03-04

    raised ticket on github.

     
  • cricrazy

    cricrazy - 2022-03-04

    Thanks @adamy.

     
  • adamy

    adamy - 2022-03-07
     
  • cricrazy

    cricrazy - 2022-03-07

    @adamy, i checked out the issue ticket. Does it have a 'Tab' functionality for auto complete implemented? Do I need to build it to test it out? Sorry, I am not a very savvy with building? I would really appreciate if you give me some directions and I can do a thorough testing.

    Thank you for the update.

     
  • cricrazy

    cricrazy - 2022-03-07

    @adamy, I downloaded and installed the MC. When I try to auto complete, using ESC + TAB. It does not register ESC, it just changes the panel using TAB key. ESC + TAB does not bring autocomplete list (for example, cd c:\users\a<esc+tab>)</esc+tab>

    My MC version shows 4.8.24.

     

    Last edit: cricrazy 2022-03-07
  • adamy

    adamy - 2022-03-08

    Configuration Options: [ x ] Complete: show all
    Config version:
    $ mc --version
    GNU Midnight Commander 4.8.27

    please confirm installation as build-224

     

    Last edit: adamy 2022-03-08
  • cricrazy

    cricrazy - 2022-03-08

    Here is version info.

    $ mc --version
    GNU Midnight Commander 4.8.24
    Built with GLib 2.51.4
    Built with S-Lang 3.0.0 libw32 with terminfo database
    With builtin Editor
    With mouse support on xterm
    With internationalization support
    With multiple codepages support
    Virtual File Systems:
    cpiofs, tarfs, sfs, extfs, ftpfs, sftpfs
    Data types:
    char: 8; int: 32; long: 32; void *: 32; size_t: 32; off_t: 32;

     

    Last edit: cricrazy 2022-03-08
  • cricrazy

    cricrazy - 2022-03-08

    @adamy, sorry, I realized that I downloaded build-223 installer. I updated it to 224. Now I can see the same build and 4.8.27. But when I try to use ESC + Tab, it beeps, but does not do anything.

     
  • cricrazy

    cricrazy - 2022-03-08

    @adamy, sorry for multiple messages. I think MC does not recognize backward slash () for the directories. When I tried to use forward slash (/), it works. For example,

    cd c:\Us[ESC+Tab] - does not work
    cd c:/Us[ESC+Tab] - works. -> c:\Users

    https://imgur.com/a/l6m5VMw

    Is there a way to have Tab as the auto completion, rather than ESC + Tab? I understand that Tab is used to switch panel selection. But I see that CTRL + Tab already does that. In fact, Ctrl+Tab is a more native windows behavior. (For example, browsers can switch tabs using Ctrl+Tab).

    Also, is there a way to stop the Beep sound when it does not work. I have a headset on and it was pretty annoying.

    Really appreciate your time. It has been very helpful.

     

    Last edit: cricrazy 2022-03-08
  • adamy

    adamy - 2022-03-09

    Internally mc understands unix paths better then win/dos;
    shall visit completion logic there might be quick win.

    Beep/alerts are fixed logic paths within the completion and other mc components, a visual-bell option may be possible yet would be for all alert conditions. FYI/ within the last release, both the beep freq and duration were reduced.

     
  • cricrazy

    cricrazy - 2022-03-09

    @adamy, I can live with Unix style of paths. But I would really appreciate if you can take a look into 'Tab' as a completion logic. We can add it as an experimental feature, in one of the options setting to enable it, if that is possible.

    Regarding the beep, does it use some beep wav file or some kind of sound file? can we just replace it with muted or low volume beep sounds? Just wondering.
    Thanks.

     
  • adamy

    adamy - 2022-03-10

    Keys can be remapping via the --keymap option, see the "mc.default.keymap" for details.
    for example remaps Complete and ChangePanel events.

    [filemanager]
    ChangePanel = ctrl-i
    [input]
    Complete = tab

    Beep is currently fixed.

     
  • adamy

    adamy - 2022-03-14

    build-225, visible bell options

     
  • cricrazy

    cricrazy - 2022-03-14

    @adamy, I installed build-225. I disabled the Audible from Display Bits > Console Alert Mode. I have not heard much beeps since there.

    But with this build225, I lost the autocompletion feature with ESC + Tab.

    I also updated my mc.default.keymap as below. at appropriate places. But even Tab is not working as intended. It is still use for panel changing.

    [filemanager]
    ChangePanel = ctrl-i
    [input]
    Complete = tab
    
     
  • adamy

    adamy - 2022-03-15

    build-225, obeys the "Esc key mode" setting, under "Configuration", as such only when enabled shall <esc-xxx> mappings be processed;, try 60000 for example.</esc-xxx>

    mc.default.keymap is not imported, plus any changes shall overwritten on an install.
    Advice you use either use the --keymap command line option or MC_KEYMAP env-var,
    create your own/supplemental file and state using an absolute path with a * .keyname* extension.

     

    Last edit: adamy 2022-03-15
  • cricrazy

    cricrazy - 2022-03-15

    @adamy, awesome. I was able to enable to all the settings. Here I am attaching screenshots for all the features for anyone else's use.

    1. Enable Esc key mode
      • Allows it to autocomplete using Esc + Tab key.
    2. Change Keymap for Auto completion to Tab using custom mc.keymap file
      • Add mc.keymap in your c:\users\username\midnight commander\ folder.
      • Add the text as described in the screenshot below.
    3. Disable beeps
     

    Last edit: cricrazy 2022-03-15
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.