From: Sashi on
Hi all,
When running a command line tool such as bc or sqlplus, I can't use
the backspace key or the delete key to erase the previously typed
character.
Backspace gives me ^? and delete gives me [[3~.
I know that in bash I can use the 'stty erase' command to set this
right but how do I do it in other tools?
I sometimes have this problem on the vim command line too, but IIRC,
vim can be corrected using fixdel.
Is there a generic way that works across tools?
I'm using putty. (I know this would make some people's lip curl
but...)
Thanks,
Sashi
From: Stephane CHAZELAS on
2008-06-18, 05:47(-07), Sashi:
[...]
> When running a command line tool such as bc or sqlplus, I can't use
> the backspace key or the delete key to erase the previously typed
> character.
> Backspace gives me ^? and delete gives me [[3~.
> I know that in bash I can use the 'stty erase' command to set this
> right but how do I do it in other tools?
> I sometimes have this problem on the vim command line too, but IIRC,
> vim can be corrected using fixdel.
> Is there a generic way that works across tools?
> I'm using putty. (I know this would make some people's lip curl
> but...)
[...]

stty erase '^?'

will work for the other tools to.

Apparently, your system's default tty settings expect
<Backspace> to send the BS character instead of the DEL one.

You can either change that with the stty command, or you could
tell your putty to send BS (^H) upon <Backspace>. See in the
configuration menus.

What is possible as well is that the terminfo database for your
value of $TERM tells the application that your backspace key is
^H. In that case, changing the putty behavior is probably the
best option.

--
St�phane
From: Joachim Schmitz on
Sashi wrote:
> Hi all,
> When running a command line tool such as bc or sqlplus, I can't use
> the backspace key or the delete key to erase the previously typed
> character.
> Backspace gives me ^? and delete gives me [[3~.
> I know that in bash I can use the 'stty erase' command to set this
> right but how do I do it in other tools?
> I sometimes have this problem on the vim command line too, but IIRC,
> vim can be corrected using fixdel.
> Is there a generic way that works across tools?
> I'm using putty. (I know this would make some people's lip curl
> but...)
In PuTTY you can quite easily change what PuTTY sends when you hit the
BACKCPACE key:
Configuration/Terminal/Keyboard, there you can switch beetween sending
Control-H and Control-?

AFAIR PuTTYs's default is ^?, which I found quite disturbing...

Bye, Jojo


From: Chad on
On Jun 18, 5:54 am, Stephane CHAZELAS <stephane_chaze...(a)yahoo.fr>
wrote:
> 2008-06-18, 05:47(-07), Sashi:
> [...]> When running a command line tool such as bc or sqlplus, I can't use
> > the backspace key or the delete key to erase the previously typed
> > character.
> > Backspace gives me ^? and delete gives me [[3~.
> > I know that in bash I can use the 'stty erase' command to set this
> > right but how do I do it in other tools?
> > I sometimes have this problem on the vim command line too, but IIRC,
> > vim can be corrected using fixdel.
> > Is there a generic way that works across tools?
> > I'm using putty. (I know this would make some people's lip curl
> > but...)
>
> [...]
>
> stty erase '^?'
>
> will work for the other tools to.
>
> Apparently, your system's default tty settings expect
> <Backspace> to send the BS character instead of the DEL one.
>
> You can either change that with the stty command, or you could
> tell your putty to send BS (^H) upon <Backspace>. See in the
> configuration menus.
>
> What is possible as well is that the terminfo database for your
> value of $TERM tells the application that your backspace key is
> ^H. In that case, changing the putty behavior is probably the
> best option.
>
> --

Would the value of $TERM, which could be ^H on the client side,
possibly override the value of $TERM on the server side?

Chad

From: Stephane Chazelas on
2008-06-18, 07:54(-07), Chad:
[...]
>> What is possible as well is that the terminfo database for your
>> value of $TERM tells the application that your backspace key is
>> ^H. In that case, changing the putty behavior is probably the
>> best option.
[...]
> Would the value of $TERM, which could be ^H on the client side,
> possibly override the value of $TERM on the server side?
[...]

$TERM is set by the client, it's passed in all the rlogin, ssh
and telnet protocols.

But what sometimes happen is that systems don't agree on what
this or that terminal behaves. For instance, one system may know
"xterm" as a terminal that sends ^H upon bs, while on another as
one that sends ^? instead.

Also, the value of $TERM on one system may not have a terminfo
entry in another system. For instance, some systems have a
"putty" entry, some haven't.

In the putty configuration, you can choose which value of $TERM
to use. You should use one for which on the target system,
there's a terminfo entry that describes as closely as possible
the putty terminal in its current emulation.

It's also possible to install *the* correct entry for "putty" on
the target system (which you can probably download from the
putty web site), either system-wide or in your own terminfo
database (see the $TERMINFO variable for how to setup your
private terminfo database).

--
St�phane