Softpanorama
(slightly skeptical) Open Source Software Educational Society

May the source be with you, but remember the KISS principle ;-)

Softpanorama Search

Midnight Commander

Old News Recommended Links Recommended Papers OFM Book Reference OFM Standard 1999
Tips Configuration Compilation mcedit MC History Etc

Midnight commander (mc) is one of the most popular Unix command line OFMs and it runs on all major UNIX flavors as well as in Windows with Cygwin installed.

It is extremely efficient, enabling the user to shuffle huge number of files with a minimum of keystrokes. There is no free lunch and this power have its price: a rather steep learning curve. The same is actually true about vi, which can be called  a representative of Orthodox file editors. Those two utilities have many things in common, including the use of the keyboard for most operations, availability of command line and the use of regular expressions.

Like any OFM, mc should be better viewed as  an extension of the command line capabilities of the shell -- a new generation of the shell interface for the Unix environment. As such mc should be used by users, programmers, and system administrators - anyone who need to work with shell scripts and manipulate the large number of files. It is perfect for performing operations on a number of selected files.  See also my  ebook for more details.

It has been said that the secret of success and longevity  of Unix is connected not so much with the operating system itself but with the philosophy, the way of thinking behind it. In The UNIX Programming Environment, Kernighan and Pike noted that the essence of Unix philosophy "is the idea that the power of a system comes more from the relationships among programs than from the programs themselves."

Most of the nongraphical utility programs that have run under Unix since the beginning, some 30 years ago, share the same user interface. It's a minimal interface, to be sure -- but one that allows programs to be strung together in pipelines to do jobs that no single program could do alone.

Most operating systems -- including modern Unix and Linux systems -- have graphical interfaces that are powerful and a pleasure to use. But none of them are so powerful as classic Unix pipes and filters glued by the programming power of the shell.

Usually Unix administrators quickly learn how to use basic shell functionality and stop their. We seldom acquire skills we can do without. OFM like mc, on the other hand, teaches shell programming in a very deep and subtle way as a slow but steady extension of the work you do simply by interacting with the mc. Faced with a choice between an hour spent on a boring, repetitive task and an hour putting together a script that will do the task, many eventually will choose the latter.

Mc permits quickly solve a typical file manipulation tasks that constitute a large percentage of a typical load for system administrators and power users. Thus mc should be viewed as a natural extension of the Unix shell and any user should put some effort into adapting bash scripts in the user menu and integrating their own "quick-fixes" for common problems.

 

Old News

mc-4.6.1-pre2 is semi-available. here is an infor from mc-devel list: 
Pavel Roskin just let me know he'll be back home a bit later than
expected. This means the official pre release will not be available
before Christmas. I can not say for sure when it will be available but I
hope it will be soon  :)  .

In the mean time pchel's pre release should be just the same thing, only
not released by the official maintainer. Please test it.

Leonard.
Re How to compile Midnight Commander

Jim Balter wrote:
> 
> Bill Bartley wrote:
> >
> > Hi to all,
> >
> > I just installed the gnu-win32 system, and as my first project
> > I was trying to compile Midnight Commander using the configure
> > script. But - after a long struggle - configure exits with
> > no Makefile created, even though I mounted the drive with
> > the -m option which is supposed to prevent configure from
> > deleting the Makefile at the end of its processing.
> 
> Where did you here that?  The -m flag has no effect in the latest
> version of cygwin, and even if it did, it wouldn't have anything to
> do with configure deleting Makefiles; why would configure ever
> delete a Makefile after going to all the trouble of making one?
> 
> > Can configure actually work? Or do I have to create the
> > Makefile by hand? Any hints on how to do this?
> 
> Your chances of receiving help will increase if you bother to
> include useful information, like the output you got when you
> ran configure.  Generally, configure runs a bunch of tests,
> printing out the results of those tests.  It also produces
> a config.h, config.status, a config.cache, and config.log,
> which you should certainly examine, and finally, if all went well,
> a Makefile.  Odds are it didn't all go well, but you have not provided
> a single clue as to what might have gone wrong, and without telepathic
> or remote viewing powers no one reading the mailing list could know.
> 
> --
> <J Q B>

Jim, thanks for responding. Here is an answer to one of your questions,
plus the files you
suggested.

1. Why I thought configure may have deleted the Makefile:

(This is from faq.html#SEC22)

"Mixed Case Filenames

The perl config causes some other problems too; the config<foo>.SH
scripts generate a 
file called "Makefile", and use and delete a file called "makefile" on
the way. Because 
of NT's case insensitivity, this will nuke Makefile, leaving you with
nothing. You can 
fix this by mounting with the 'mixed' option."

Since I could find no Makefile at the end of the process, I thought
maybe that 
running configure under gnu-win32 had the same problem.


2. This is the final output of configure:

"Configuration:

  Source code location:       .
  Compiler:                   gcc
  Compiler flags:             -g
  File system:                Midnight Commander Virtual File System
                              tarfs
  Text mode screen manager:   SLang with termcap
  Install console saver:      no
  Text mode mouse library:    xterm only
  Debugger code:              none
  With subshell support:      yes
  X11 versions:               none
  Install path:               //D/cygnus/H-i386-cygwin32/bin,
//D/cygnus/H-i386-cygwin32/lib/mc"

3. Here are the contents of config.log:

"This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

gcc -E
gcc -E"

4. Here the contents of config.cache:

ac_cv_c_const=${ac_cv_c_const='yes'}
ac_cv_c_cross=${ac_cv_c_cross='yes'}
ac_cv_dnamesize=${ac_cv_dnamesize='no'}
ac_cv_dusum=${ac_cv_dusum='dusum_useb=yes; dusum_factor=1'}
ac_cv_func_cfgetospeed=${ac_cv_func_cfgetospeed='no'}
ac_cv_func_crypt=${ac_cv_func_crypt='no'}
ac_cv_func_gethostbyname=${ac_cv_func_gethostbyname='no'}
ac_cv_func_getmntent=${ac_cv_func_getmntent='no'}
ac_cv_func_getmntinfo=${ac_cv_func_getmntinfo='no'}
ac_cv_func_getpagesize=${ac_cv_func_getpagesize='no'}
ac_cv_func_getwd=${ac_cv_func_getwd='no'}
ac_cv_func_grantpt=${ac_cv_func_grantpt='no'}
ac_cv_func_initgroups=${ac_cv_func_initgroups='no'}
ac_cv_func_mmap=${ac_cv_func_mmap='no'}
ac_cv_func_putenv=${ac_cv_func_putenv='no'}
ac_cv_func_pwdauth=${ac_cv_func_pwdauth='no'}
ac_cv_func_socket=${ac_cv_func_socket='no'}
ac_cv_func_statfs=${ac_cv_func_statfs='no'}
ac_cv_func_statvfs=${ac_cv_func_statvfs='no'}
ac_cv_func_strcasecmp=${ac_cv_func_strcasecmp='no'}
ac_cv_func_strdup=${ac_cv_func_strdup='no'}
ac_cv_func_strerror=${ac_cv_func_strerror='no'}
ac_cv_func_strncasecmp=${ac_cv_func_strncasecmp='no'}
ac_cv_func_truncate=${ac_cv_func_truncate='no'}
ac_cv_func_valloc=${ac_cv_func_valloc='no'}
ac_cv_header_crypt_h=${ac_cv_header_crypt_h='yes'}
ac_cv_header_dirent_dirent_h=${ac_cv_header_dirent_dirent_h='yes'}
ac_cv_header_fcntl_h=${ac_cv_header_fcntl_h='yes'}
ac_cv_header_grp_h=${ac_cv_header_grp_h='yes'}
ac_cv_header_limits_h=${ac_cv_header_limits_h='yes'}
ac_cv_header_malloc_h=${ac_cv_header_malloc_h='yes'}
ac_cv_header_memory_h=${ac_cv_header_memory_h='yes'}
ac_cv_header_minix_config_h=${ac_cv_header_minix_config_h='yes'}
ac_cv_header_mntent_h=${ac_cv_header_mntent_h='yes'}
ac_cv_header_mnttab_h=${ac_cv_header_mnttab_h='yes'}
ac_cv_header_stdc=${ac_cv_header_stdc='no'}
ac_cv_header_string_h=${ac_cv_header_string_h='yes'}
ac_cv_header_sys_dustat_h=${ac_cv_header_sys_dustat_h='yes'}
ac_cv_header_sys_filsys_h=${ac_cv_header_sys_filsys_h='yes'}
ac_cv_header_sys_fs_types_h=${ac_cv_header_sys_fs_types_h='yes'}
ac_cv_header_sys_fstyp_h=${ac_cv_header_sys_fstyp_h='yes'}
ac_cv_header_sys_mkdev_h=${ac_cv_header_sys_mkdev_h='yes'}
ac_cv_header_sys_mount_h=${ac_cv_header_sys_mount_h='yes'}
ac_cv_header_sys_param_h=${ac_cv_header_sys_param_h='yes'}
ac_cv_header_sys_statfs_h=${ac_cv_header_sys_statfs_h='yes'}
ac_cv_header_sys_statvfs_h=${ac_cv_header_sys_statvfs_h='yes'}
ac_cv_header_sys_types_h_makedev=${ac_cv_header_sys_types_h_makedev='no'}
ac_cv_header_sys_vfs_h=${ac_cv_header_sys_vfs_h='yes'}
ac_cv_header_sys_wait_h=${ac_cv_header_sys_wait_h='yes'}
ac_cv_header_unistd_h=${ac_cv_header_unistd_h='yes'}
ac_cv_header_utime_h=${ac_cv_header_utime_h='yes'}
ac_cv_lib_ICE=${ac_cv_lib_ICE='no'}
ac_cv_lib_bsd=${ac_cv_lib_bsd='no'}
ac_cv_lib_crypt=${ac_cv_lib_crypt='no'}
ac_cv_lib_crypt_i=${ac_cv_lib_crypt_i='no'}
ac_cv_lib_curses=${ac_cv_lib_curses='no'}
ac_cv_lib_dir=${ac_cv_lib_dir='no'}
ac_cv_lib_dnet=${ac_cv_lib_dnet='no'}
ac_cv_lib_dnet_stub=${ac_cv_lib_dnet_stub='no'}
ac_cv_lib_gen=${ac_cv_lib_gen='no'}
ac_cv_lib_gpm=${ac_cv_lib_gpm='no'}
ac_cv_lib_inet=${ac_cv_lib_inet='no'}
ac_cv_lib_nsl=${ac_cv_lib_nsl='no'}
ac_cv_lib_pt=${ac_cv_lib_pt='no'}
ac_cv_lib_seq=${ac_cv_lib_seq='no'}
ac_cv_lib_socket=${ac_cv_lib_socket='no'}
ac_cv_lib_sun=${ac_cv_lib_sun='no'}
ac_cv_lib_termcap=${ac_cv_lib_termcap='no'}
ac_cv_make_with_percent_rules=${ac_cv_make_with_percent_rules='yes'}
ac_cv_path_AR=${ac_cv_path_AR='//D/cygnus/H-i386-cygwin32/bin/ar'}
ac_cv_path_CHMOD=${ac_cv_path_CHMOD='//D/cygnus/H-i386-cygwin32/bin/chmod'}
ac_cv_path_CP=${ac_cv_path_CP='//D/cygnus/H-i386-cygwin32/bin/cp'}
ac_cv_path_MC=${ac_cv_path_MC='//D/cygnus/H-i386-cygwin32/bin/mc'}
ac_cv_path_MV=${ac_cv_path_MV='//D/cygnus/H-i386-cygwin32/bin/mv'}
ac_cv_path_RM=${ac_cv_path_RM='//D/cygnus/H-i386-cygwin32/bin/rm'}
ac_cv_path_install=${ac_cv_path_install='//D/cygnus/H-i386-cygwin32/bin/install
-c'}
ac_cv_path_x=${ac_cv_path_x='no_x= ac_x_includes= ac_x_libraries='}
ac_cv_prog_AWK=${ac_cv_prog_AWK='gawk'}
ac_cv_prog_CC=${ac_cv_prog_CC='gcc'}
ac_cv_prog_CPP=${ac_cv_prog_CPP='gcc -E'}
ac_cv_prog_HAVE_FILECMD=${ac_cv_prog_HAVE_FILECMD='false'}
ac_cv_prog_HAVE_nroff=${ac_cv_prog_HAVE_nroff='false'}
ac_cv_prog_LN_S=${ac_cv_prog_LN_S='ln -s'}
ac_cv_prog_RANLIB=${ac_cv_prog_RANLIB='ranlib'}
ac_cv_prog_gcc=${ac_cv_prog_gcc='no'}
ac_cv_prog_gnu_make=${ac_cv_prog_gnu_make='yes'}
ac_cv_prog_make_make_set=${ac_cv_prog_make_make_set='no'}
ac_cv_prog_system=${ac_cv_prog_system='CYGWIN32/95'}
ac_cv_struct_st_blksize=${ac_cv_struct_st_blksize='yes'}
ac_cv_struct_st_blocks=${ac_cv_struct_st_blocks='yes'}
ac_cv_struct_st_rdev=${ac_cv_struct_st_rdev='yes'}
ac_cv_type_mode_t=${ac_cv_type_mode_t='no'}
ac_cv_type_off_t=${ac_cv_type_off_t='no'}
ac_cv_type_pid_t=${ac_cv_type_pid_t='no'}
ac_cv_type_uid_t=${ac_cv_type_uid_t='no'}
ac_cv_type_umode_t=${ac_cv_type_umode_t='no'}
fu_cv_sys_d_ino_in_dirent=${fu_cv_sys_d_ino_in_dirent='no'}
fu_cv_sys_mounted_getsstat=${fu_cv_sys_mounted_getsstat='no'}
fu_cv_sys_mounted_vmount=${fu_cv_sys_mounted_vmount='yes'}
fu_cv_sys_stat_fs_data=${fu_cv_sys_stat_fs_data='no'}
fu_cv_sys_stat_statfs2_bsize=${fu_cv_sys_stat_statfs2_bsize='no'}
fu_cv_sys_stat_statfs2_fsize=${fu_cv_sys_stat_statfs2_fsize='no'}
fu_cv_sys_stat_statfs3_osf1=${fu_cv_sys_stat_statfs3_osf1='no'}
fu_cv_sys_stat_statfs4=${fu_cv_sys_stat_statfs4='no'}

5. config.status was a zero-byte file.
-
For help on using this list, send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".
Midnight Commander config under IceWM. MEPIS.org
Applications
Hey, Group.

If I log in with KDE, the font size of Midnight Commander is perfect whether in the "launch" window size or maximized. Very readable (15 inch monitor). The same goodness when launched in a term via Alt-F2 and typing "mc".

If I log in with IceWM, the launch window size is hard to read for the old eyes; maximizing only shows more files/directories at the same hard-to-read font.

Trawling through ~/.kde hasn't led to any inspiration, nor have the archives of www.ibilio.org/mc/ (well, as far as I was able to concentrate, anyway).

Any directions to a configuration file? Greatly appreciated.
Thanks in advance.

Very best wishes to you all and your families. Merry Christmas.

Cheers. Newt.
(Oh, BTW, Mepis 2003.10...Newbie).

mc under IceWM

Playing around today: if I call Midnight Commander from an rxvt terminal, things are O.K. font-size-wise like they are if called from Konsole. (This is when logged in to IceWM.)

Seems to be an xterm issue. Any ideas?

Thanks and Holiday best to all.

Cheers. Newt.
 

mc under IceWM

Arghh.
Never mind. Xterm it is. (Googling is bearing fruit.)
I can...Shift+"Keypad-plus" and "-minus" to jack the font size.

Should be able to config from here-on in.

Cheers. Newt.
 

You can create a .Xresource

You can create a .Xresources;
  http://www.wlug.org.nz/XtermNotes

____
x x \
L
-/
 
 

 

Recommended Links


In case of broken links please try to use Google search. If you find the page please notify us about new location
Google     

GNU Midnight Commander File Manager -- home of version 4.6.0 (Pavel Roshkin, the official maintainer)

freshmeat.net Project details for Midnight Commander

Debian Bug report logs package mc

Debian Reference - Debian tutorials/mc

BeBits - Advanced Midnight Commander -- forked version

MCUtils for the GNU Midnight Commander

Linux Orbit - Features The LO Newbie Tests Mouseless (Midnight) Commander

Home Page:
http://www.gnome.org/mc/ -- now defunct, see http://www.ibiblio.org/mc/
RPM resource mc

 Recommended Articles

Official

GNU Midnight Commander File Manager

Manual

General

An Introduction to the Midnight Commander

Midnight Commander tutorial short and very generic tutorial

[May 25, 2001] Inside Solaris - Midnight Commander  -- pretty basic paper

A long time ago, on another computing platform, Peter Norton Computing released Norton Commander. This became my favorite file management program. As I wandered further and further into the UNIX realm, I found it hard to believe that a program like this wasn't available on UNIX. Finally, I came across Midnight Commander, as shown in Figure A. It offers more features than Norton Commander and, unlike Norton Commander, it runs on a variety of different computing platforms.

Midnight Commander tips

Midnight Commander - NC clone for Unix shell (!!!!!!!)
http://www.gnome.org/mc/
1) Esc-1 = F1 ... Esc-0 = F10
2) ^x-c - CHMOD (like Drabek's PROTECT).
3) Display Mode - contains submenu where you cal select full/brief, etc.
Under tree view there are subcommands:
f2 - rescan
f4 - static/dynamic - ?
4) TAB works, so does copy and delete.
5) Hotkey work in menus.
6) ^F - PgDn.
7) Filters work - ura!
8) 'Info about files' in right/display - same as Info in VC.
9) Options/menu file edit - 1st time you do this it creates
local menu for you!
I already defined a menu item! Woiks!
10) Dir tree - use right and left to move up and down level.
11) Find File - works.
12) Options/config/verbose - should turn off dialog for
copying file, but doesn't work.
13) ^U works (swaps panels).
14) Command history works.
15) What about speedsearch ?
16) Meta key is ESC, for example Esc-* inverts selection.
17) Installed on CRL - yay!
Reading FAQ...
18) In viewer: Space- PgDn, ^B - PgUp.
19) Found Netterm font that supports graf chars -
MS Linedraw!!! And garbage on the screen disappeared.
20) After pressing F9 you can access menu thru shortcut.
21) How to PgDn in fileman ? ^V and ESC V to go back, like EMACS.
22) How to ins filename in cmdline ? ESC-ENTER!
23) Cmdline history window - F9 c h. Only stores cmds that
are entered with panels on.
24) White '*' works to invert selection. And '+' works too.
25) Esc-Tab - filename completion. Press again to show
window of choices if prefix is ambiguous.
26) Gooky errmsg: 'shell is already running a command'.
Then segmentation fault comes if you ^O.
Sounds like bug.
27) Find out what 'network link' is for. It is for comp
that runs mcserv.
28) Checking TAR support - supposedly you can read it like dir (yay!) - works!
29) Closing FTP link - '..' in root dir. Same with TAR file.
O, ftp supports urls!
Can also do cd ftp://xyz - works!
This is very fast way to browse archives, because don't need to
dl thru modem. So is Lynx, though.
30) F9 C E - edit extension file.
31) I mapped by Inlink account - left panel CRL and right Inlink.
Vou!!!!!!!!!!!
Also, saved inlink as dir in hotlist.
Cannot rexec commands.
32) ESC-ESC is documented key - single ESC is used as Meta.
F10 also works as Cancel in dialogs.
33) View for man page does not work - 'terminal Tascii unknown'.
34) F9 O S - save setup.
F9 L F - left filter.
F9 C C - compare directories.
35) See if there is online MC manual. There is, on their homepage!
36) mc -c - color mode.
-v - load internal viewer (Use LIST alias).
37) Can pass 2 dir names to MC - for IPL.
38) If you have no permission to enter dir, MC quietly ignores your
attempt.
39) ^X P - pastes selected panel name into cmdline.
^X ^P - same for unselected panel.
^X T - paste names of selected files  to cmdline - o, something
other commanders can't do!
^X ^T - for unsel panel.
ESC P, ESC N - goto to prev/next command in history.

ESC F, ESC B - move word forward/backward in cmdline (and this is
key for TCSH too, I bet... It is!).
^D - DELCHAR (TCSH too).
^K - ERASE EOL.
ESC BS - delword backward
40) ^T - tag file.
41) There is hint mode in MC - shows hints over cmdline.
42) You can map FTP drives to both panels and copy files directly.
 

Info-search tips for Midnight Commander users Linux Gazette

Info-search tips for Midnight Commander users Mon, 31 Jan 2000 14:57:13 -0800

From: Ben Okopnik <fuzzybear@pocketmail.com>

Funny thing; I was just about to post this tip when I read Matt Willis' "HOWTO searching script" in
LG45. Still, this script is a good bit more flexible (allows diving into subdirectories, actually
displays the HOWTO or the document whether .gz or .html or whatever format, etc.), uses the Bash shell
instead of csh (well, _I_ see it as an advantage <grin>...), and reads the entire /usr/doc
hierarchy - perfect for those times when the man page isn't quite enough. I find myself using it about as
often as I do the 'man' command.

You will need the Midnight Commander on your system to take advantage of this (in my opinion, one of
the top three apps ever written for the Linux console). I also find that it is at its best when used
under X-windowsi, as this allows the use of GhostView, xdvi, and all the other nifty tools that aren't
available on the console.

Here's the script.

To use it, type (for example)

doc xl

and press Enter. The script will respond with a menu of all the /usr/doc subdirs beginning with 'xl'
prefixed by menu numbers; simply select the number for the directory that you want, and the script will
switch to that directory and present you with another menu. Whenever your selection is an actual file, MC
will open it in the appropriate manner - and when you exit that view of it, you'll be presented with the
menu again. To quit the script, press 'Ctrl-C'.

A couple of built-in minor features (read: 'bugs') - if given a nonsense number as a selection, 'doc'
will drop you into your home directory. Simply 'Ctrl-C' to get out and try again. Also, for at least one
directory in '/usr/doc' (the 'gimp-manual/html') there is simply not enough scroll-back buffer to see all
the menu-items (526 of them!). I'm afraid that you'll simply have to switch there and look around;
fortunately, MC makes that relatively easy!

Oh, one more MC tip. If you define the 'CDPATH' variable in your .bash_profile and make '/usr/doc' one
of the entries in it, you'll be able to switch to any directory in that hierarchy by simply typing 'cd
<first_few_letters_of_dir_name>' and pressing the Tab key for completion. Just like using 'doc', in
some ways...

Hope this is of help.

 

 

Linux

Midnight Commander - The File Manager

Linux.com CLI magic Midnight Commander

Midnight Commander

MacOS

macosxhints - 10.3 Install the GNU Midnight Commander from source

Solaris:

Please note that you need to use bash for mc: some capabilities like an integrated shell windows (Ctrl-O) does not work with ksh or other shells.

Precompiled MC can be downloaded from http://sunfreeware.com/. This is the most authoritative source and includes versions for Solaris 8 and Solaris 7.
Attention: before installation glibc needs to be installed. After that check LD_LIBRARY_PATH. It should include the target directory (/usr/local/lib).
Other possible sources of MC for Solaris include:

BSD:

HP-UX: Software Porting And Archive Centre For HP-UX

Etc:  HTTP Virtual File System

 

Tips

More 2 Cent Tips & Tricks LG #81

Sat, 6 Jul 2002 13:40:26 -0500 (COT)
RE Otta (obob from qwest.net)
Previous Tip by Ashwin M (ashwin_n@gmx.net)
This is in reply to the LG issue 80, 2c Tip #18.

It is simpler to use Midnight Commander. Click on the rpm file like you would a directory and transverse the rpm as you would a branch of the directory tree. Locate the file or files and copy them to an actual directory with the copy button. Simple and effective!

[John Karns] I've found that some mc versions changed the rpm handling behavior. I had grown quite accustomed to viewing rpm contents and copying parts via mc, then after installing SuSE 7.1 on my laptop, was no longer able to view more than a partial list of the files in the rpm; specifically the rpm headers (description, etc.). I was able to correct the problem finding the mc scripts used for rpm handling, and changing one to agree with a previous mc version script.
One other point is that for very large rpm files (over 2 or 3 MB), the process can be very slow. When dealing with rpm files containing large tar balls of source code, I usually just "install" the rpm, which copies the desired file to /usr/src/packages/SOURCES.

 

mc-cdrtools by Sami Lempinen This utility contains four user menu entries for manipulating CD-Rs:

They are quite handy for quickly moving stuff over to a CD-R.

Note that mkisofs and cdrecord are required. You may want to edit the entries to suit your taste for the command line options for mkisofs, write speed and SCSI unit for cdrecord etc.

More 2 Cent Tips & Tricks LG #51

Info-search tips for Midnight Commander users

Mon, 31 Jan 2000 14:57:13 -0800
From: Ben Okopnik <fuzzybear@pocketmail.com>

Funny thing; I was just about to post this tip when I read Matt Willis' "HOWTO searching script" in LG45. Still, this script is a good bit more flexible (allows diving into subdirectories, actually displays the HOWTO or the document whether .gz or .html or whatever format, etc.), uses the Bash shell instead of csh (well, _I_ see it as an advantage ...), and reads the entire /usr/doc hierarchy - perfect for those times when the man page isn't quite enough. I find myself using it about as often as I do the 'man' command.

You will need the Midnight Commander on your system to take advantage of this (in my opinion, one of the top three apps ever written for the Linux console). I also find that it is at its best when used under X-windows, as this allows the use of GhostView, xdvi, and all the other nifty tools that aren't available on the console.

Here's the script.

To use it, type (for example)

doc xl

and press Enter. The script will respond with a menu of all the /usr/doc subdirs beginning with 'xl' prefixed by menu numbers; simply select the number for the directory that you want, and the script will switch to that directory and present you with another menu. Whenever your selection is an actual file, MC will open it in the appropriate manner - and when you exit that view of it, you'll be presented with the menu again. To quit the script, press 'Ctrl-C'.

A couple of built-in minor features (read: 'bugs') - if given a nonsense number as a selection, 'doc' will drop you into your home directory. Simply 'Ctrl-C' to get out and try again. Also, for at least one directory in '/usr/doc' (the 'gimp-manual/html') there is simply not enough scroll-back buffer to see all the menu-items (526 of them!). I'm afraid that you'll simply have to switch there and look around; fortunately, MC makes that relatively easy!

Oh, one more MC tip. If you define the 'CDPATH' variable in your .bash_profile and make '/usr/doc' one of the entries in it, you'll be able to switch to any directory in that hierarchy by simply typing 'cd <first_few_letters_of_dir_name>' and pressing the Tab key for completion. Just like using 'doc', in some ways...

Hope this is of help.

 

Black creen after Ctrl-O
If you see a black screen after using CTRL+O в Midnight Commander you might benefit from setting everywhere (in  .Xdefaults, /etc/X11/Xdefaults) option:
XTerm*VT100*titeInhibit: off

It might be that options in /etc/X11/Xdefaults has higher priority and does not always overright options in ~/.XDefaults

[Debian] When I work with MC via xterm there are some problems with keys

The first that you should do is to tune local and Xkb. Withouth it to tume mc keys is a lot of pain. If you have problem with Alt=<key> you need to modify /usr/X11R6/lib/X11/app-defaults/XTerm. At the end of the file you need to add:

*VT100*translations: #override \
 aReturn: string(0x1b) string(0x0d) \n\
 aTab: string(0x1b) string(0x09) \n\
 aspace: string(0x1b) string(" ") \n\
 aa: string(0x1b) string("a") \n\
 ab: string(0x1b) string("b") \n\
 ac: string(0x1b) string("c") \n\
 ad: string(0x1b) string("d") \n\
 ae: string(0x1b) string("e") \n\
 af: string(0x1b) string("f") \n\
 ag: string(0x1b) string("g") \n\
 ah: string(0x1b) string("h") \n\
 ai: string(0x1b) string("i") \n\
 aj: string(0x1b) string("j") \n\
 ak: string(0x1b) string("k") \n\
 al: string(0x1b) string("l") \n\
 am: string(0x1b) string("m") \n\
 an: string(0x1b) string("n") \n\
 ao: string(0x1b) string("o") \n\
 ap: string(0x1b) string("p") \n\
 aq: string(0x1b) string("q") \n\
 ar: string(0x1b) string("r") \n\
 as: string(0x1b) string("s") \n\
 at: string(0x1b) string("t") \n\
 au: string(0x1b) string("u") \n\
 av: string(0x1b) string("v") \n\
 aw: string(0x1b) string("w") \n\
 ax: string(0x1b) string("x") \n\
 ay: string(0x1b) string("y") \n\
 az: string(0x1b) string("z")

Problems using fonction keys (F1 - F12)

Biju Chacko botsie at xfce.org
Wed Nov 24 05:46:18 UTC 2004


Benedikt Meurer wrote:
> Piotr Chmura wrote:
> 
>> Dnia Tue, 23 Nov 2004 12:49:53 -0800, Brian J. Tarricone  
>> <bjt23 at cornell.edu> napisał:
>>
>>> On 11/23/04 20:13, Rakotomandimby (R12y) Mihamina wrote:
>>>
>>>> Hello,
>>>> I mostly use mc as file manager for my remote server.
>>>> mc works with the function keys.
>>>> Unfortunately, for example i I want to quit mc, I have to press F10:
>>>> that makes tha terminal to pull down its menu.
>>>> How do you advice me to manage it ?
>>>> I want to keep the keys for mc.
>>>> I'm running the 4.2 version of XFCE (debian testing package from
>>>> os-cillation).>>>
>>>
>>>
>>> that would depend on what terminal you're running.  note that 'xfterm4'
>>> just runs xterm by default, or whatever your TERMCMD environment 
>>> variable
>>> specifies.  xfce doesn't come with its own terminal (yet).
>>>
>>> so essentially, the answer you're looking for is: either reconfigure
>>> your terminal to not use that key for menus, or, if that isn't possible,
>>> use a different terminal that doesn't use that key.
>>>
>>>     -brian
>>
>>
>>
>> In mc combination of pressing 'Esc' and then a number should work also...
>>
>> for example:
>> F4 <=> 'Esc' '4'
>> F10 <=> 'Esc' '0'
> 
> 
> If you use Terminal (the debian package is named xterminal), you can 
> disable F10 in Preferences -> Shortcuts.

If you use gnome-terminal (like I do) you can just switch off the menu. 
Then F10 works fine for mc and you can still access the menu by 
right-clicking on the term.

-- b
The svlug 2002-January Archive by Thread

[svlug] About mc

Marc MERLIN marc_news@vasoftware.com
Sun Jan 20 23:45:02 2002

 


On Fri, Jan 18, 2002 at 11:23:13PM -0800, J C Lawrence wrote:
> Not quite.  While mc does have some keyboard rebinding as we went
> over the last time round, it doesn't support keyborad binding to the
> extent I want (rebinding alpha keys).  

True, just like vi, there are commands that you only get with
CTRL-X CTRL-key, and you can't change 'key' easily

On Fri, Jan 18, 2002 at 11:58:17PM -0800, J C Lawrence wrote:
> Loosely what I want is single pane, single directory view with the
> ability to interactively (in the move the cursor about and hit
> command keys sense) copy, move, rename, etc files with a very fast

which mc can all do, in a single pane if you wish.

> large file viewer that doesn't insist on loading them into memory.

Neither does mc's
I actually use mc's viewer to do binary in place edits, and they are done on
the right disk block without loading the file in memory.

> If the command keys are letter based (c=copy, d=delete, m-move,
> r=rename, etc I'm fine and configurability is not needed.  I don't

Different philosophy. With  mc, alphanum keys  go in the command  line since
you can build a command line at  all times (equivalent of the select command
line you  were talking about),  so obviously you can't  use c for  copy, you
have to use some other key.
But eh, you're fond of mc, regardless of technical attributes, so for you it
is going to be better.

> want to launch editors, run scripts, or handle spiffy regxes -- just
> text mode point, select, and shoot.  Not particularly interested in

mc does that.

> an internal command line.  Don't want help.  Copy destination can be

Well, you get both.

> typed in, or can be walked to and then copy invoked.  Can't think of
> any reason I'd be interested in ALT-TAB.

With  mc, you  can type  "cp", select  your files,  CTRL-X T,  and type  the
destination if you with (including tab completion)

> The emphasis is on speed and simplicity.  One of the things I really

Anyone who sees me use mc usually can't follow what I do :-)
It's all about knowing the tool.

On Sat, Jan 19, 2002 at 02:57:42AM -0800, Erik Steffl wrote:
> which offers better navigation (searching, marks etc)). I just tried to
> open 22MB file (kernel bz2) and it opened it in lot less then 1 second,
> so I am pretty sure it does not load the whole file into memory, at
> least not in the beginning.
 
It does not, you  can open /dev/sdax, and it'll load block  on demand, as it
should.

On Sat, Jan 19, 2002 at 01:36:32PM -0800, J C Lawrence wrote:
> The bindings I'd like would be something like:
> 
>   ENTER -- (on file) less, on directory CD
>   SPACE -- tag
>   C -- copy
>   D -- delete
>   M -- move
>   R -- rename (mv)
>   L -- hard link
>   Q -- quit
>   S -- sym-link
 
This is clearly incompatible with the command line feature in mc, which you
may not use, but that's not the point.
 
> I have use for a file manager no more than once or twice a month.

I can do complex  copies, moves and rename with mc faster  than you can type
them.

> > It is kinda arrogant from a program to not let you assign any
> > keybindings but IMO it's not serious usability problem.
> 
> I generally consider it critical.
 
I guess that's why you use emacs and not vi then :-)
I, for one, am  damn happy that vi users don't get to  remap all the keys to
anything they'd like, otherwise it'd be a complete mess.


On Sun, Jan 20, 2002 at 04:43:27PM -0800, J C Lawrence wrote:
> > in mc they are right in front of you. you don't have to learn
> > anything.
> 
> I find myself having to read the function key labels near every
> time.  I'd rather not, especially as they're abbreviated.
 
Tss, tss...
 
> Silly examples: The may MC handles cross-directory operations is the
> exact opposite of what I prefer.  mc requires the other pane to be
> on the target and the current pane to be the source.  Aaaargh!  That

That's how most  people seem to want  it, but if you really  want to, CTRL-U
will exchange both panes, but mc was  meant to emulate nc, so it does behave
the same as a result (only better)

> catches me almost every time.  The second confirm/edit/etc step
> under mc when doing a tagged file operation is something I've never
> wanted (or used) and would really like to never see.  

Well, then instead of complaining, you could go in the Options/Confirmation
menu, and disable them.

>   ObNote: I'd also much prefer it if mc left me in the directory it
>   was viewing when I exited, rather than the directory I started it
>   from.

Then it wasn't installed properly.
In Red Hat and Debian:
root@gandalf:~# type mc
mc is a function
mc () 
{ 
    MC=/tmp/mc$$-"$RANDOM";
    /usr/bin/mc -P "$@" >"$MC";
    cd "`cat $MC`";
    /bin/rm "$MC";
    unset MC
}

> Arguably that's little different from list.
> 
> > jojda:~>time mc
> 
>   $ time mc
>   real    0m0.469s
>   user    0m0.000s
>   sys     0m0.040s
 
On my system,
real    0m0.239s
user    0m0.050s
sys     0m0.020s

but who's counting?
Both are  plenty fast, and  quibbling about  sub second launch  time, coming
from an emacs user is middly ironic I think...

Marc
-- 
Microsoft is to operating systems & security ....
                                      .... what McDonalds is to gourmet cooking
  
Home page: http://marc.merlins.org/   |   Finger marc_f@merlins.org for PGP key

[svlug] About mc

Erik Steffl steffl@bigfoot.com
Sun Jan 20 23:49:01 2002

 


J C Lawrence wrote:
> 
> On Sat, 19 Jan 2002 23:58:50 -0800
> Erik Steffl <steffl@bigfoot.com> wrote:
> > J C Lawrence wrote:
> >> On Sat, 19 Jan 2002 02:57:42 -0800 Erik Steffl
> >> <steffl@bigfoot.com> wrote:
> 
> >> I have use for a file manager no more than once or twice a month.
> >> I'm not going to learn the keys, and if I do I'm unlikely to
> 
> > in mc they are right in front of you. you don't have to learn
> > anything.
> 
> I find myself having to read the function key labels near every
> time.  I'd rather not, especially as they're abbreviated.

  ? most of them are not:

1Help   2Menu   3View   4Edit   5Copy   6RenMov 7Mkdir  8Delete 9PullDn
10Quit 

  the only confusion is menu <-> pullDn (menu is user menu, pull down is
the application menu).

  a little bit more detail about function keys (Fn <-> esc-n):

  mc uses ctrl and meta modifiers, if meta is not available it uses esc
(esc, then key). since the function keys are not as common and generally
it's harder to make them work the meta n (n=1, ..9, 0) double the
function of Fn. So the safest bet is to hit esc-n, that should work in
most situations. I wasn't sure why you dislike function keys - if the
reason was that they are not as widely available (or don't work) then
esc-n would be a good solution.

  as far as speed goes you can also use meta-n instead, that way you do
not have to leave the home row. on debian (i386 arch) the meta seems to
be the window key (at least that's what it is on my system and I don't
remember doing any changes in this area). it's still not as good as
whatever you want it to remap to but it's somewhat better as far as
typing goes.

...
> > it doesn't limit you in any way and it's simpler than ctrl-z
> > etc. (nothing prevents you from using ctrl-z though).
> 
> Except that Ctrl-Z works everywhere, with everything.

  so use it with mc just like you would with list. it's hardly a fault
of mc that it provides additional functionality (that does not limit you
in any way).

...
> > generally traversing the directory trees is easier using file
> > manager (less keystrokes, you see what's happening)
> 
> TAB completion is your friend.  ido.el under (X)Emacs make it

  yes, but not a (boy)|(girl)friend/spouse, i.e. it's ok to have more
than one friend.

...
> > not modern destop design, modern desktop machines: there are no
> > space (HD or RAM) constraints that would excuse lack of readily
> > available on-line doc (man page, context sensitive help etc.). how
> > else would you learn how to use a program?
> 
> A man page is not context sensitive help.  However it, and perhaps a
> README, is enough for the majority of cases.  For the rest throwing
> something under /usr/share/doc handles most other cases.

  for a gui program there is no excuse not to have context sensitive
help. why should a user have to go someplace else and go through
irrelevant info when program knows exactly where the user is a can
provide relevant help information?

> >> SELECT <file-spec> <command>
> >>
> >> Brought up a scrolling text list of the matching files which
> >> could be cursored among and tagged/untagged with SPACE.  Hitting
> >> ENTER ran the provided command on all tagged entries.
> >>
> >> That alone under bash would remove 90% of my need/wish for a file
> >> manager (I faintly understand you can do something not entirely
> >> dissimilar under zsh, but I haven't looked into that yet).
> 
> > it's not exactly the same but that kind of functionality is
> > covered by command line auto-completion,
> 
> Aye, that's a standard (and heavily used) feature here.  it doesn't
> do much however for the "I want to run this command on some
> arbitrary selection of those files" case.

  mc can be used then, even though the order of operations is slightly
different:

  1: mc
  2a: select files
  2b: type the command
  3: hit ctrl-x t<enter>
  then F10 if you don't want to use mc anymore...

  it has the same effect as you describe, it's a little bit less
effective as far as typing goes (but not much) - it shouldn't matter if
you use it rarely, if you'd use it more often you would probably already
be in mc.

  2a and 2b can be done in any order.

  2a: there are several ways to select files you want to use:

    insert tags/untags files
    + enables you to type in shell patter or regexp (configurable)
    meta-? is a simple version of find+grep
    ctrl-x ! let's you run any program that returns list of files (e.g.
find)

  you do not have to use all the fancy file picking mechanizms, if you
want to stay simple you can use insert and possibly +

  3: you can edit the resulting command line before hitting enter
(unfortunately not using your shell, it gets into shell history though).

  you have to know the ctrl-x t spell though. then again, you have to
know select if you want to use it so it's basically the same (and
there's context sensitive help in mc when you forget the keybinding).

  note that while what I describe is somewhat complicated you can use it
in very simple form, in that case it's basically the same as select. the
additional functionality does not stand in your way...

...
> Err, to repeat the point, I don't.  File management is perhaps less
> than 3% of my time, if that.

  what I was saying is that I am not all the way on the other side (as
you suggested). In fact if it weren't for mc I would probably use file
managers less than 10% (at least that was the case before I've found mc)
and be quite happy.

...> > I don't get it. What is it that LIST does that mc does not?
> 
> Faster, smaller, lighter, more unobtrustive, easier/more-intuitive
> cross-directory operations, default/expected key bindings, less
> cruft.  I don't want a swiss army knife.  I just want a small fruit
> knife.


  smaller: yes (but who cares?)

  faster: NO, see the timing of startup/exit below, and there doesn't
seem to be any detectable speed difference during operation.

  more unobtrusive: mc even let's you work in your shell, how can it be
any less obtrusive? you can have nothing but panel on the screen...

  intuitive: list is not intuitive at all, without using the help screen
you wouldn't be able to do almost anything. 'c' does not copy. v is for
NV (arc viewer) [linux version, IIRC it is somewhat better in DOS
version] etc. mc is not anymore intuitive than that but at least it is
easy to get help, it displays basic keys on the screen (if you want it
to) and lot of keys are the same as nc uses (which is/was sort of de
facto standard)

  cross directory ops: linux list doesn't seem to have any. haven't find
a way to copy a file (intuitive???). what I remember from dos version is
that it brings up dialog where you can type in the destination, which is
exactly what mc does. mc provides the oposite panel's directory as
default but you can start typing your own destination right away so it
doesn't slow you down at all, it even provides auto-completion
(meta-tab).

  key bindings: list definitely does NOT provide expected key bindings,
specially the linux version. the dos version - perhaps and if you like
those then that's a valid point against mc. still - you cannot change
them so how is it that you know what to expect when you hit r? is it
remove or rename? intuitive?

  the knife analogy is not a valid one in this case. the extra
functionality of mc does not come at significant cost - the only
difference is that the program is bigger, it does not have almost any
difference on start-up time (that's the only possible difference). the
HD space it takes up is not of concern (today and even less concern in
the future). How is the extra functionality of mc standing in your way?
If you don't know about the extra keybindings you simply don't use them.
What's the problem?

...
> >> mc enforces a UI which I find nearly unusable and supports a raft
> >> of features that I find distracting from what I'm
> 
> >  ? every UI program enforces its UI. every CLI program enforces
> > its UI as well. LIST does. not sure why you are singling mc out.
> 
> Because I don't like mc's choices?

  in one panel configuration it is basically the same as list...

...
> Silly examples: The may MC handles cross-directory operations is the
> exact opposite of what I prefer.  mc requires the other pane to be
> on the target and the current pane to be the source.  Aaaargh!  That

  (sort of repeated from above) no it does not. it just provides it as
default, you can immediately type in your own destination just as if the
default wasn't there. it even provides auto-completion. what more (or
less) do you want? how is list better than that?

> catches me almost every time.  The second confirm/edit/etc step
> under mc when doing a tagged file operation is something I've never
> wanted (or used) and would really like to never see.

  you get the same dialog in list. how else would you specify the
destination? it does not make any sense. what do you mean?

>   ObNote: I'd also much prefer it if mc left me in the directory it
>   was viewing when I exited, rather than the directory I started it
>   from.

  list or any other program does not do that either. and cannot. that's
why cd is internal shell command (child cannot change the parent process
environment, cwd etc.)

  however, there's a sort of solution for this, here's a relevant quote
from man page:

      -P     At  program  end, the Midnight Commander will print
              the last working directory.  This  function  should
              not  be  used  directly, instead, it should be used
              from a special shell function that  will  automati­
              cally  change the current directory of the shell to
              the last directory the Midnight  Commander  was  in
              (thanks  to Torben Fjerdingstad and Sergey for con­
              tributing this function and the  code  implementing
              this      option).       Source      the      files
              /usr/lib/mc/bin/mc.sh (bash and zsh users)  respec­
              tively /usr/lib/mc/bin/mc.csh (tcsh users) in order
              to have this function defined.


> > you can fire it off anytime you want and quit it with single
> > keystroke, it's not a monster that would take forever to start up:
> 
> Arguably that's little different from list.
> 
> > jojda:~>time mc
> 
>   $ time mc
>   real    0m0.469s
>   user    0m0.000s
>   sys     0m0.040s
> 
>   $ time list
>   real    0m0.098s
>   user    0m0.070s
>   sys     0m0.020s

jojda:~/skusobna/list>time ./list
0.010u 0.000s 0:00.10 10.0%     0+0k 0+0io 217pf+0w
jojda:~/skusobna/list>time mc

0.020u 0.000s 0:00.10 20.0%     0+0k 0+0io 388pf+0w
jojda:~/skusobna/list>

  I compiled the list (crowe's version for linux) and above are the
results on my machine. I would say that you cannot distinguish between
list and mc (as far as start-up time goes). Not sure how to measure
anything else but from visually judging the speed I don't think there's
any significant difference.

  btw on your computer it says that real time was 0.469s while the sum
of other times was a lot less - that means that there was something else
going on on the system. Or perhaps it was waiting for a disk to load the
file (mc itself, that would mean that you'd have to wait for about .5s
when you start mc first time/after a very long time - that's not such a
big deal).  Since I already ran mc I obviously cannot test the first
start right now...

> No promises on not having a slow finger, tho I tried not to.
> 
> > you can even run it with command line, it's not some internal
> > funky CLI, it's your login shell, basically unchanged, you just
> > hit ctrl-o to make panels disappear (but you _don't_ _have_ to use
> > this feature, you can just quit mc or use ctrl-z)
> 
> I like the bash command line and want it to be my default CLI UI.

  good. as far as comparison between list and mc goes: mc is basically
the same but provides you with you shell even from within mc (and yes,
it's bash shell (or whatever your login shell is), not some internal
funky shell).

> Nothing else, just bash as configured by my .bashrc, under an xterm
> as configured (and keys re-bound) as per my .Xdefaults.  I like
> that and would like to stay with it, augmenting it only in the areas
> mentioned, not replacing or changing large chunks of it.

  OK. that's what I do as well. whether you augment it using list or
using mc there's no difference in obtrusiveness, I would argue that mc
is less obtrusive because it lets you use you shell even when you run mc
(again, this functionality does not come at a price - if you don't want
it just don't use it, it does not prevent you from using ctrl-z or quite
mc etc.).

> > also: menu bar, command line, status line, hint line can all be
> > turned off so you're left with panel(s) only.
> 
> I'd rather (almost always) have visible the bottom end of scrollback
> (usually the last 20 or 100 lines depending on window size, with a
> further 5K lines available under PgUp/PgDn)).  That I find useful
> and use dozens of times a day.  The vast majority of the time I
> don't have a use for the panes.

  so at those time do not run the file manager or use ctrl-o with mc (or
ctrl-z), that's what I do as well. have an xterm, sometime run mc in it,
depending on what I do. when I want to use command line again (in the
same xterm) I either quit mc or use ctrl-o (depending on what I think I
will be doing).

  ctrl-o has an advantage of keeping the directories of shell and mc in
synch - if you are in mc and change directory the shell's cwd changes as
well, if you hit ctrl-o and cd in shell the mc's cwd changes too (that
wouldn't happen if you used ctrl-z). again: you do not have to use this
feature and it doesn't cost you anything... IMO it makes perfect sense,
specially for people who do significant amount of work using command
line but that's just me - you might not find it useful and you do not
have to use it (or even know about it). it's not forced on you.

> > mc is not an integrated solution.
> 
> We disagree.

  how is mc more integrated solution than list? you can use it in the
same way that you use list (in principle, it's, of course, not exactly
the same).

> Stylistically I'd prefer something that handled mail far closer to
> the way MH approaches handling mail than the way that any of the
> mbox-based tools do.

  what is this about? and BTW as far as email goes the best way to store
it is to use IMAP (which IIRC is what you do, or at least advocate).

> >> Hurm.  John Crowe's list (OSS) seems a fairly good starting
> >> point.  Its got most of the basic supports there already.  I
> >> really should take some time off and just hack it into shape.
> 
> > he recommends mc as well:-) just checked the web page.
> 
> Yeah, I know.
> 
> > the more you're explaining the more I find your position strange.
> > everything that you write (apart from keybindings configuration)
> > points to mc. yet you don't like it. is it something personal?
> 
> Nope, just what I've written.

  but based on what you've written you want mc! (overall, apart from the
keybindings) I am quite confused - what you're saying about how you work
makes sense (I work in similar way even though not on the same kind of
tasks) but when it comes to mc you're suddenly strange... well, one way
or another, I guess that's it from me, I hope you didn't find it too
pushy... (=unless you want to continue discussion I am not goin to
continue with my mc evangelism).

	erik

 

 

[svlug] About mc

Erik Steffl steffl@bigfoot.com
Mon Jan 21 02:18:01 2002

 


J C Lawrence wrote:
> 
> On Sun, 20 Jan 2002 23:48:18 -0800
> Erik Steffl <steffl@bigfoot.com> wrote:
...
> > mc provides the oposite panel's directory as default but you can
> > start typing your own destination right away so it doesn't slow
> > you down at all, it even provides auto-completion (meta-tab).
> 
> Arrrgh.  Why not TAB like everything else?  Why M-TAB?  Yeesh!
> (don't answer that, I know the answer, I just don't like it).

  actually that's one key-binding you can redefine in learn keys dialog
(all others are basically keys, just this one is sort-of-function
completion/m-tab). the consequence is that you cannot use tab to move
between panels (AFAIK you have to use mouse) but if you only use one
panel it might not matter that much (tab is also used in dialogs but you
can use arrows for that).

...
> I'll assume from prior comments that you use vi instead of XEmacs.
> Why?

  not sure, I learned it first, then I discovered vim and I am quite
happy with it, don't feel that everything has to be part of editor, I
rather use external tools.

> Take your answers and apply them in reverse and I suspect you'll
> find many of my reasons for not wishing to use mc and looking for a
> much more vi-like tool (well, minus vi key bindings).

  as I see it you want ed instead of vi:-)

  I mean I understand if you don't want to use nautilus or some other
megaloman of a filemanger but mc? it is lean and mean and does
filemanagement, doesn't have a flight simulator in it or programming
language or whatever extra stuff that some other programs include (not
that there's anything wrong with that, it's just that not everybody
likes that style)

...
> In mc:
> 
>   In pane 1 tag some files.
> 
>   Move to pane 2
> 
>   Navigate to a directory.
> 
>   Hit copy key (forget what it is).
> 
> Fails.  Why?  mc requires focus to be in the source of the tagged
> operation, not the target.

  that's because that's how it works basically everywhere. even in list,
you select source, hit c, specify target; apart from the patological
case you described (if directory is selected, the tagged files are
copied into it).

...
> If I haven't indicated, in any possible way, a target, then I can
> live with a dialog.  If I have indicated a possible target, for
> instance by having the cursor on a dir (LIST behaviour), then use
> that and don't ask me.

  that's not possible* when using two panels (it might be a possible
enhancement of single panel mode), it's also surprising because that's
not how it works in most other applications (and somewhat inconsistent)

  * it is possible but would be even more confusing than when it's a
single panel, it would also mean that you basically have to go to target
panel before copy/move etc., quite a mess.

> >> ObNote: I'd also much prefer it if mc left me in the directory it
> >> was viewing when I exited, rather than the directory I started it
> >> from.
> 
> > list or any other program does not do that either. and
> > cannot. that's why cd is internal shell command (child cannot
> > change the parent process environment, cwd etc.)
> 
> Actually you can but you need to use a wrapper ala the one Marc

  hey, that's what I posted as well (a quote from man page).

	erik

[svlug] About mc

J C Lawrence claw@kanga.nu
Mon Jan 21 12:14:01 2002

 


On Mon, 21 Jan 2002 01:51:22 -0800 
Erik Steffl <steffl@bigfoot.com> wrote:
> J C Lawrence wrote:
>> On Sun, 20 Jan 2002 23:48:18 -0800 Erik Steffl
>> <steffl@bigfoot.com> wrote:

>> Take your answers and apply them in reverse and I suspect you'll
>> find many of my reasons for not wishing to use mc and looking for
>> a much more vi-like tool (well, minus vi key bindings).

>   as I see it you want ed instead of vi:-)

For a file manager?  Kinda, yes, tho more in an MH style.

> I mean I understand if you don't want to use nautilus or some
> other megaloman of a filemanger but mc? it is lean and mean and
> does filemanagement, doesn't have a flight simulator in it or
> programming language or whatever extra stuff that some other
> programs include (not that there's anything wrong with that, it's
> just that not everybody likes that style)

I want leaner and meaner, and far more atomic.

>> In mc:
>> 
>> In pane 1 tag some files.
>> 
>> Move to pane 2
>> 
>> Navigate to a directory.
>> 
>> Hit copy key (forget what it is).
>> 
>> Fails.  Why?  mc requires focus to be in the source of the tagged
>> operation, not the target.

> that's because that's how it works basically everywhere. 

I can't comment on everywhere, but I've not noticed that behaviour
in other tools before and its not the way I expect or want.

> even in list, you select source, hit c, specify target; apart from
> the patological case you described (if directory is selected, the
> tagged files are copied into it).

Uhh, but that is a way of specifying target.  If I run mc in dual
pane mode, and do the above, why shouldn't/wouldn't it accept it as
a default/intended target?

>> If I haven't indicated, in any possible way, a target, then I can
>> live with a dialog.  If I have indicated a possible target, for
>> instance by having the cursor on a dir (LIST behaviour), then use
>> that and don't ask me.

> that's not possible* when using two panels

Sure it is.  Just take the above example and have the copy work.

> (it might be a possible enhancement of single panel mode), it's
> also surprising because that's not how it works in most other
> applications (and somewhat inconsistent)

Oddly enough its exactly what I expect and is what seems most
obvious to me:

  Okay, I want these files >here< and I want to move them over, umm,
  (fiddle, fiddle, fiddle) yeah, over here.

mc dictates instead:

  Okay, I want these files >here< and I want to move them over, umm,
  (fiddle, fiddle, fiddle) yeah, over here, but oh yeah, where were
  those files again?

Can't comment on any other applications.  Inconsistent?  

>   * it is possible but would be even more confusing than when it's
> a single panel, it would also mean that you basically have to go
> to target panel before copy/move etc., quite a mess.

No.  Just have both work.  If there is a second panel, always accept
it as the default target of a copy, no matter where focus is UNLESS
the cursor is on a valid target (eg directory) in either panel, in
which case accept that instead by default (as long as its not
tagged).

				-+-

I wandered thru http://chuck.burkins.net/LinuxFile.html yesterday.

  Asides from being X11 based SFM is rather nice.  Pleasingly small
  and pleasingly hackable.  Wish it were text mode.  Basic key
  bindings can be lived with, but can be changed (source edits)
  without too much difficulty.  There's a .deb as well.  

In looking thru sunsite/ibiblio I found hm:

  http://www.ibiblio.org/pub/Linux/utils/file/managers/hm-3.1.tar.gz

Fairly promising.  Will need some source hacking to fix the key
bindings and get rid of the confirms on things like `rm`.
Annoyingly it fails to respond to window resizes which I do a lot
of.

More interestingly zselx approaches the SELECT problem.  

  http://www.ibiblio.org/pub/Linux/utils/file/managers/zselx-1.1.tar.gz

I need to play with it more.  It would be considerably nicer if it:

  -- accepted the command to run on the command line
  -- accepted a filespec (eg *.c) instead of just a directory spec.
  -- could accept multiple filespecs on the command line
  -- could accept the list of files to display from stdin (kinda
  tough with a CURSES app I know)

-- 
J C Lawrence                
---------(*)                Satan, oscillate my metallic sonatas. 
claw@kanga.nu               He lived as a devil, eh?		  
http://www.kanga.nu/~claw/  Evil is a name of a foeman, as I live.

[svlug] About mc

Marc MERLIN marc_news@vasoftware.com
Mon Jan 21 14:01:01 2002

 


On Mon, Jan 21, 2002 at 12:19:24AM -0800, J C Lawrence wrote:
> Quite.  For what you do, especially as a SysAdm, mc is invaluable.
> I, umm, don't tend to do that much SysAdm, especially not on a daily
> basis.
 
Fair enough.
 
> I just checked, and perhaps I'm missing something in playing just
> now, but I don't see anything in the options that disabled (for
> instance) the dialog on a tagged copy which asks:
> 
>   Copy # files with source mask to:
> 
>   To: 
 
I  thought you  were talking  about confirm  delete/overwrite and  so forth.
Indeed, for copy and move, you do  get a window, but it's not a confirmation
window, it's  a window that  lets you change  the destination (if  you don't
want to be using  the second pane), lets you rename  files by regex patterns
are you copy/move them, select how  to copy symlinks and file attributes and
so forth.
 
> > Then it wasn't installed properly.  
> 
> On a Debian system:
> 
>   $ type mc
>   mc is /usr/bin/mc
 
You are right, it's a damn shame. I guess I forgot that on all my debian
systems, the function came from me.
On Red Hat and other distros, the function gets installed with the package.
 
On Mon, Jan 21, 2002 at 12:23:12AM -0800, J C Lawrence wrote:
> On Sun, 20 Jan 2002 23:42:53 -0800 
> Marc MERLIN <marc_news@vasoftware.com> wrote:
> 
> > I, for one, am damn happy that vi users don't get to remap all the
> > keys to anything they'd like, otherwise it'd be a complete mess.
> 
> Why?  I assume you would never use that capability, but those that
> would, could, and their user-local configs (~.vimrc?) would not
> affect you unless you logged in as them for some reason (in which
> case you get what's coming to you).

I guess I'm biased because I get to experience that when the user comes and
asks for help and that I have to use their keyboard.
It's just  as annoying than a  user with a  DVORAK keyboard who needs  me to
type on their keyboard.

Marc
-- 
Microsoft is to operating systems & security ....
                                      .... what McDonalds is to gourmet cooking
  
Home page: http://marc.merlins.org/   |   Finger marc_f@merlins.org for PGP key

[svlug] About mc

J C Lawrence claw@kanga.nu
Mon Jan 21 14:21:01 2002

 


On Mon, 21 Jan 2002 14:00:07 -0800 
Marc MERLIN <marc_news@vasoftware.com> wrote:
> On Mon, Jan 21, 2002 at 12:19:24AM -0800, J C Lawrence wrote:

>> Why?  I assume you would never use that capability, but those
>> that would, could, and their user-local configs (~.vimrc?) would
>> not affect you unless you logged in as them for some reason (in
>> which case you get what's coming to you).

> I guess I'm biased because I get to experience that when the user
> comes and asks for help and that I have to use their keyboard.
> It's just as annoying than a user with a DVORAK keyboard who needs
> me to type on their keyboard.

Hurm, an option to define what RC to use would seem to solve that
(eg point i at yours).

-- 
J C Lawrence                
---------(*)                Satan, oscillate my metallic sonatas. 
claw@kanga.nu               He lived as a devil, eh?		  
http://www.kanga.nu/~claw/  Evil is a name of a foeman, as I live.
How to avoid launching Midnight Commander by accident Linux Gazette
Commander by accident
Mon, 26 Feb 2001 10:31:51 -0500

Allan Peda (apeda from linkshare.com)

I've typed "mc foo bar" one time too many when I really meant to type "mv foo bar". Removing Midnight
commander is not an option, because that breaks some file exploror type GUI utilities, so I cooked up a
bash script to double confirn that I wanted to type what I (probably mis-)typed :

See attached script mc.bash.txt


Copyright © 1996-2009 by Dr. Nikolai Bezroukov. www.softpanorama.org was created as a service to the UN Sustainable Development Networking Programme (SDNP) in the author free time. Submit comments This document is an industrial compilation designed and created exclusively for educational use and is placed under the copyright of the Open Content License(OPL). Site uses AdSense so you need to be aware of Google privacy policy. Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.

Disclaimer:

Last modified: August 15, 2009