Ubuntu – How to type curly braces while using the TTY

keyboard-layouttty

When I'm running on battery, I prefer to use the TTYs instead of the full blown GUI as I can squeeze a lot more run time out this way.

However, when I want to type in curly braces (AltGrShiftรจ and AltGrShift+ on my Italian keyboard) the TTY (and only that TTY) acts as if I was holding my Alt key.

I also get this problem for any AltGr-Shift key combination — the curly braces are just the most commonly used for me.

Why is that? How can I prevent it?

Here's my output for stty -a:

speed 38400 baud; rows 48; columns 160; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-    parenb -parodd cs8 hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon ixoff
-iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon -iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke

Best Answer

run

sudo dpkg-reconfigure console-setup

to reconfigure your console-setup. During this process you can specify you keyboard setup including the AltGr setup.

If no confguration options are presented run

sudo dpkg-reconfigure -plow console-setup

instead.

Under Origin of the keyboard select the correct layout. For example: the US keyboard doesn't have an AltGr key at all. Whereas the German keyboard does have an AltGr key.

Under AltGr key replacement: select the position of the AltGr key. Most likely you want to choose Right Alt.

Don't forget to reboot or run setupcon on your tty console.

Related Question