Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I currently run Openbox on a light netinstall of Debian. In Tilda, when I use a program like nslookup or winexe, some of my keys do not work properly.

  • Backspace generates ^?
  • Up generates ^[[A
  • Left generates ^[[D
  • Down generates ^[[B
  • Right generates ^[[C
  • Delete generates ^[[3

This is not an issue when I am typing from the bash prompt itself, only when the programs are running within Tilda. This also does not happen when I run the same programs from an xterm window.

What gives?

share|improve this question

Inside bash, interpreting these keys is handled by the readline library, which will see those sequences and do the correct actions. Outside bash, you're relying on the tty line discipline to interpret them. See this recent question and its answers for more info on that process: Clear / erase a mistyped invisible password on a shell / terminal in Linux

The line discipline doesn't handle keys like Up, Left, Down, Right, and Delete. If I run nslookup myself in an xterm right now, they do the same thing -- that's normal behavior. (I don't have winexe to test).

Backspace is a different issue. You can change what the backspace and delete keys send in the Tilda preferences window (under Compatibility). Or you can make sure that your TTY is configured with the right characters by checking the output of stty -a, and setting the erase character to match what's being sent with stty erase ^?.

share|improve this answer
Finally some clarity. I've been wondering why my apps behaved differently than the shell for several weeks now. I didn't know that readline() was different than other shell reading functions, such as fgets() and read(), and I didn't that this is what bash used. Thanks! – Samuel Sep 3 '15 at 18:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.