# Alt key not working in Midnight Commander



## zogoibi (Nov 9, 2012)

Hello all. I've just installed the Midnight Commander in FreeBSD 9.0 from package and I've realized with surprise that the Alt key is not working when opening mc in the console, but it works when opening mc in an xterm.

So, for example: mc in the console, the combination Alt+Enter (which copies a file to the command line), or Alt+p (which prints the previous command) behave exactly as if Alt hadn't been pressed; i.e., as "Enter" or as "p" in the two examples above.

But mc in an xterm, the Alt key works as expected. Also when in linux it works as expected, same in the console or in X.

So, what's the difference between the console and the xterm for this behaviour? Or what's the difference between the FreeBSD console and the Linux console? How can I work around this problem?

Any help appreciated, thanks.


----------



## df (Nov 9, 2012)

For quick workaround you could try using Escape instead of ALT, when in console.


----------



## zogoibi (Nov 9, 2012)

That works! Thank you.

Anyhow, is it possible to make Alt work as Alt and Escape as Escape in Midnight Commander when on a tty?


----------



## graemeg (Feb 8, 2013)

I have the same problem under FreeBSD 9.1. ESC does work (thanks for that info), but getting ALT to work would be preferred.


----------



## jb_fvwm2 (Feb 8, 2013)

Not working in the console, but working in an xterm... I've the same issues (since v9)? with either the up arrow or the pageup key... one of them doesn't respond at a plain console before Xorg (iirc), which slows down some reading of text files considerably. So I'd be interested in a a fix found in base and put into STABLE...


----------



## gqgunhed (Feb 8, 2013)

Keep the Esc-key in mind as this works over an SSH-session, too.
E.g. issuing "Esc-0" will get you an "F10" to exit mc 
I think it is dependent on the terminal type and its working with the special keys (Escape sequences).


----------



## covex (Jul 31, 2016)

I have to same issue on FreeBSD 10.3. I do not think this is mc issue, but more likely xterm. Using Alt_L 
KeyPress event, serial 38, synthetic NO, window 0x1000001,
  root 0x49a, subw 0x0, time 37843513, (962,643), root964,662),
  state 0x10, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
  XLookupString gives 0 bytes:
  XmbLookupString gives 0 bytes:
  XFilterEvent returns: False

KeyRelease event, serial 38, synthetic NO, window 0x1000001,
  root 0x49a, subw 0x0, time 37843881, (962,643), root964,662),
  state 0x18, keycode 64 (keysym 0xffe9, Alt_L), same_screen YES,
  XLookupString gives 0 bytes:
  XFilterEvent returns: False

with any letter results in some "non standard" characters to be output 
$ áóäæçèêë

The kernel=vt konsole works OK, also aterm does not have this behavior.


----------



## covex (Jul 31, 2016)

Hm, so at least this seems like a "workaround" - 
http://obscure-tech-tips.blogspot.cz/2009/12/how-to-fix-xterm-on-cygwin-when-alt-key.html


----------

