# Right Alt key not working in FreeBSD console



## mr123 (Dec 22, 2021)

When using the FreeBSD console, I am able to use the left Alt key to invoke the line editing commands in the shell (/bin/sh). For example, I am able to use `Meta-Backspace` to delete the previous word, where `Meta` is the left Alt key. However, I am unable to use the right Alt key to invoke any Meta commands. How do I enable the use of the right Alt key?


----------



## Andriy (Dec 23, 2021)

Might be related to right Alt being used as AltGr or something like that.
Can't help you much beyond that.


----------



## mr123 (Dec 23, 2021)

Andriy said:


> Might be related to right Alt being used as AltGr or something like that.
> Can't help you much beyond that.



I noticed that Esc-Backspace produces the same result as left Alt-Backspace. Why does the Esc key act as a Meta key while the right Alt key doesn't?

I am using a US keyboard.


----------



## covacat (Dec 23, 2021)

edit  (or clone) /usr/share/vt/keymaps/us.kbd and replace ralt with lalt
then reload the new keymap with kbdcontrol -l


----------



## covacat (Dec 24, 2021)

alternatively you can set
kern.vt.enable_altgr=0


----------

