Dup Goto 📝

MidnightCommanderPercentMacros

PT2/linux/midnight-commander 08-15 16:24:20
To Pop
26 lines, 201 words, 1088 chars Saturday 2026-08-15 16:24:20

I thought this was a weird bug until I discovered what was happening. % is used as a variable sigil. For example

echo %d %f

will print

/path/to thefile

if thefile is selected and we are in dir %d.

Macro What it Expands To
%f The currently highlighted/selected file name
%F The selected file in the unselected panel
%d The path of the current working directory
%D The path of the directory in the unselected panel
%s All currently tagged/selected files
%% A literal % symbol

How to Bypass Macro Parsing

If you want to pass raw commands directly to your shell without MC expanding % macros:

  1. Hide the panels: Press Ctrl + o to toggle off the MC panels and jump directly into your subshell. Typing echo %% here will output %% (or behave according to your shell's rules). Press Ctrl + o again to return to the MC layout.
  2. Escape manually: Continue using %% whenever you want a single % passed through the MC command prompt.