Backspace, del, arrow keys not working with interactive programs in Tilda

7,316

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:
7,316
bw.
Author by

bw.

Updated on September 18, 2022

Comments

  • bw.
    bw. over 1 year

    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?

  • Samuel
    Samuel over 8 years
    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!