1

Please, I cannot figure out how to fill-in absolute path filename in mc (Midnight commander)? I am familiar with ALT+ENTER to drop the filename onto the line, but that is just the relative filename, I would expect SHIFT+ALT+ENTER to drop absolute path filename, but nope :( any hints? Thanks!

3 Answers 3

2

The following shortcuts were always available in Midnight Commander IIRC:

  • CTRL+x (CTRL no more pressed) + p - the absolute path of the current panel
  • CTRL+x (CTRL is still being pressed) + p - the absolute path of the opposite panel
2
  • thanks for this tip!
    – crysman
    Dec 18, 2022 at 21:46
  • moreover, this works on SSH session, too! :)
    – crysman
    Dec 22, 2022 at 20:16
2

There are another combinations for mc:

  1. Select file/folder.
  2. Press Esc+A (it will insert path into the command line).
  3. Press Esc+Enter (it will insert name).

Works for ssh (putty/KiTTy) session for me.

1

Nope, not SHIFT+ALT+ENTER :) But you are very close.

I didn't know the keys either and looked it up just now in the source code for you.
I haven't tried it but it will work.

The following are lines 119 and 120 from mc's keymap.c

    {"PutCurrentSelected", "alt-enter; ctrl-enter"},
    {"PutCurrentFullSelected", "ctrl-shift-enter"},//<---- HERE

If you want to know any other keys, you can look here starting around line 100. You don't need to be able to read 'c' as these arrays are self explanatory.

I have been using this puppy for over 20 years but didn't know these keys so thanks for adding to my mc skill set.

Good Luck!

4
  • I'm glad it helped you :) And thanks for sharing the direct link to the source! Unfortunately, it's not working for me, more specifically, it's not working on our server via SSH (GNU Midnight Commander 4.8.22 Built with GLib 2.58.2). On my laptop, though, it works fine (GNU Midnight Commander 4.8.26 Built with GLib 2.68.1) - using Gnome Terminal 3.38.1 - where the problem might be?
    – crysman
    Apr 19, 2022 at 16:26
  • I am guessing that those keys aren't being sent through your ssh session. I don't know how to fix this but I can guess that you can at least change the key bindings and rebuild the source with different bindings. Apr 19, 2022 at 21:02
  • If I get a chance, I will play with your scenario later. Apr 19, 2022 at 21:05
  • @crysman If this key doesn't work on your terminal, do CTRL+x, p, Alt+Enter.
    – Niccolo M.
    Jan 25, 2023 at 23:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .