You are not logged in.

#1 2013-09-07 12:17:01

MatejLach
Member
From: United Kingdom
Registered: 2011-06-22
Posts: 314
Website

[SOLVED] A B C D printed when using arrow keys in console

I never experienced this problem before, but recently my arrow keys started to misbehave in some situations.

Whenever I am in nconfig for example, my arrow keys don't work as expected, but instead print ^[[A^[[B^[[C^[[D^
My $TERM variable is set to xterm and my cat -v output from the arrow keys is also ^[[A^[[B^[[C^[[D^

This also happens in virtualbox, but in ViM, nano and man page viewer, the arrow keys behave normally.
In my vconsole.conf, I've just set KEYMAP=uk

Any help much appreciated.

EDIT: This happens in all terminal emulators and tty as well.

Last edited by MatejLach (2013-09-07 18:57:54)

Offline

#2 2013-09-07 16:54:56

cookies
Member
Registered: 2013-01-17
Posts: 253

Re: [SOLVED] A B C D printed when using arrow keys in console

From what you told us, I would guess that it's the expected behaviour. if I start thunar (or whatever) from a ternimal emulator, I can switch focus to the terminal emulator, hit one of the arrow keys and I get those strange characters printed. Once I terminate thunar, the arrow keys work like you would expect and don't print any abc stuff anymore.

After reading https://bbs.archlinux.org/viewtopic.php … 9#p1319349 (yes, it's about colours, but it's quite interesting anyway), I would say that while your terminal emulator is waiting for input, it interprets the key codes from the arrow keys as move coursor left or right/search through command history/whatever. If you have some other process running, that process decides how to interpret those key codes, which seems to be (in most cases) "just escape those characters and print them on the screen".

If my thunar example does not match your problem, please give a more detailed description.

Offline

#3 2013-09-07 17:39:37

MatejLach
Member
From: United Kingdom
Registered: 2011-06-22
Posts: 314
Website

Re: [SOLVED] A B C D printed when using arrow keys in console

cookies wrote:

From what you told us, I would guess that it's the expected behaviour. if I start thunar (or whatever) from a ternimal emulator, I can switch focus to the terminal emulator, hit one of the arrow keys and I get those strange characters printed. Once I terminate thunar, the arrow keys work like you would expect and don't print any abc stuff anymore.

After reading https://bbs.archlinux.org/viewtopic.php … 9#p1319349 (yes, it's about colours, but it's quite interesting anyway), I would say that while your terminal emulator is waiting for input, it interprets the key codes from the arrow keys as move coursor left or right/search through command history/whatever. If you have some other process running, that process decides how to interpret those key codes, which seems to be (in most cases) "just escape those characters and print them on the screen".

If my thunar example does not match your problem, please give a more detailed description.

From what I gathered, it seems like terminfo and what my terminal actually outputs mismatch somehow.
(I haven't touched the $TERM variable)

Let me try to explain in more detail:

Let's say am invoking nconfig.
Normal behaviour would be to let me to move up/down around the menus using the arrow keys, (which works as expected under root, but not under my user account) - however nconfig DOES NOT let me move down in nconfig  using the arrow keys, but instead prints the ASCII equivalent of the key I just pressed, so:

Pressing arrow key down:

Expected behaviour: move one item down the list
What actually happens: ^[[B is printed and the list does not move down, as required.

Because this does not happen under root, it must be some (mis)configuration in my user account, however as I never touched $TERM or anything remotely connected to it, I have no idea what it could be.

Offline

#4 2013-09-07 18:45:05

cookies
Member
Registered: 2013-01-17
Posts: 253

Re: [SOLVED] A B C D printed when using arrow keys in console

Okay, that definitely should not happen. Maybe it's something like https://bbs.archlinux.org/viewtopic.php … 82#p922982 that's messing up with ncurses here, too.

Offline

#5 2013-09-07 18:56:26

MatejLach
Member
From: United Kingdom
Registered: 2011-06-22
Posts: 314
Website

Re: [SOLVED] A B C D printed when using arrow keys in console

cookies wrote:

Okay, that definitely should not happen. Maybe it's something like https://bbs.archlinux.org/viewtopic.php … 82#p922982 that's messing up with ncurses here, too.

That's exactly it.
Damm zsh alias!!!

Thanks.

Offline

Board footer

Powered by FluxBB