Midnight commander: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
|||
Line 42: | Line 42: | ||
I added the following to my bashrc: | I added the following to my bashrc: | ||
alias mc="DISPLAY= mc" | alias mc="DISPLAY= mc" | ||
==Your own file handlers== | |||
<!-- | |||
You can create a user-specific: | |||
~/.config/mc/mc.ext | |||
But you might want to edit the system-wide | |||
/etc/mc/mc.ext | |||
...which is also useful for examples | |||
Entries look something like | |||
shell/.iso/i | |||
View=%view{ascii} isoinfo -d -i %f | |||
Where the '''first line''' is one of | |||
* <tt>shell/''pattern''</tt> - substring match, after a dot if one is there, so imitating DOS style file extensions | |||
* <tt>regex/''pattern''</tt> - extended POSIX regexp | |||
* <tt>type/''pattern''</tt> - matched against the output of `file %f` | |||
* the above three can end with /i to become case insensitive | |||
* <tt>default</tt> - matches any file | |||
The '''second line''' is in the form | |||
keyword=command | |||
where '''keyword''' is one of: | |||
* Open - reacts to Enter | |||
* View - reacts to F3 | |||
* Edit - reacts to F4 | |||
* Drop - reacts to drag and drop | |||
* Icon - reserved | |||
* otherwise: interpreted as the name of a submenu{{verify}} | |||
and '''command''' has a number of substitutions... | |||
* %d - current working directory | |||
* %p - current file's basename{{verify}} | |||
* %f - full path | |||
:: if on a non-local virtual filesystem (e.g. tarfs or ftpfs), the file will be copied and you get the path to that temporary file -- if you want to avoid that you could use %d/%p | |||
* %s - space separated list of selected files | |||
* %t - list of tagged files | |||
* %u - list of tagged files, will be untagged after the command | |||
* the above in uppercase: same idea, in the other panel | |||
...and other special behaviour: | |||
* %cd path that mc should change to (handles vfs names) | |||
* %view - command's output will be piped into mc's viewer | |||
** %view without and command means that viewer opens it itself | |||
** %view{ascii} | |||
** %view{hex} | |||
** %view{nroff} | |||
** %view{unform} | |||
* %var{VAR:default} will expand env (similar to bash's ${VAR-default} ) | |||
the system-wide one groups images, groups sound, groups video, and more, | |||
and may use | |||
/usr/lib/mc/ext.d | |||
...also to wrap in things like [[xdg-open]] | |||
--> | |||
https://softpanorama.org/OFM/MC/extension_menu.shtml |
Revision as of 14:51, 11 September 2023
midnight commander is a text mode file browser, one of many interrelated clones you can trace back to norton commander.
Very slow start
Possibilities:
- You're starting it in a directory that has a lot of entries
- Or the other panel is. In some cases something like mc . . would help
- Your host lookup setup is flawed (and this isn't the only thing affected)
- It's trying to interact with X
- Diagnosis: doing a strace mc will show it hangs after mentioning MIT-MAGIC-COOKIE-1)}} until a timeout some seconds later
If you don't care about X, clearing DISPLAY would be a quick fix.
I added the following to my bashrc:
alias mc="DISPLAY= mc"