[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: xterm and mc shortcuts



On Tue, Jan 24, 2006 at 10:06:25AM +0200, Andras Lorincz wrote:
> Hi,
> 
> I'm using xterm but there is a thing that annoys me: when I'm using xterm as
> a normal user there is no problem using the shortcuts with mc (Alt+C or
> Alt+S an so on), but as I do a su in the same vt and try to use the
> shortcuts with mc, there appear some carachters. So how could I make the
> shortcuts work when I am root? Thanks.

There are a number of reasons this can go wrong.  Most likely, though,
it's a different TERM setting ("echo $TERM" to check).  This tells mc
what escape codes to expect from the terminal (emulator) -- which is
defined in some terminal capabilities database, typically "terminfo"
these days (the ancient "termcap" would be another option).

You can check what entry is actually being read by mc, using strace:

  strace -efile -o /tmp/mc.trace mc
  (...quit mc)
  grep term /tmp/mc.trace

For example, I get something like

open("/home/ab/.terminfo/x/xterm", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/share/terminfo/x/xterm", O_RDONLY|O_LARGEFILE) = 3

which tells me that /usr/share/terminfo/x/xterm is being used.
Do this as your regular user and as root and compare what you get...

Next thing to compare would be stty settings ("stty -a").

Unfortunately, there's more...  but maybe this helps to solve it already.

What do you get when you type Ctrl-v, immediately followed by the
shortcut in question?  (do this outside of mc, or in its subshell)

Cheers,
Almut



Reply to: