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

Re: xterm and mc shortcuts



For root I get this:

open("/root/.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
open("/root/.terminfo/x/xterm", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/share/terminfo/x/xterm", O_RDONLY|O_LARGEFILE) = 4

and for user get this:

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

so /usr/share/terminfo/x/xterm is used in both cases. Regarding the stty -a output they are also the same. When pressing Ctrl-V the behaviour is the same: if I press once then nothing and if I press twice then ^V appears. If I press once Ctrl-V followed by Alt-c the same character appears.

I must mention that this behaviour is happening in mlterm too but not in konsole.

On 1/24/06, Almut Behrens < almut_behrens@gmx.net> wrote:
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


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: