screen-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: stty erase & ssh & vi


From: David Balazic
Subject: RE: stty erase & ssh & vi
Date: Mon, 5 Jul 2004 17:39:53 +0200

> if [ -x /usr/bin/tput ]; then
>  if [ "x`tput kbs`" != "x" ]; then # We can't do this with "dumb" terminal
>   stty erase `tput kbs`
>  elif [ -x /usr/bin/wc ]; then
>   if [ "`tput kbs|wc -c `" -gt 0 ]; then # We can't do this with "dumb"
> terminal
>    stty erase `tput kbs`
>   fi
>  fi
> fi
> 
> I have no idea why this code exists, as it appears to do nothing useful.
> 
It fixes the backspace problem. I puit it in all systems that I use ( either
in a system wide configuration or a personla login script ), because
otherwise the backspace does not work correctly.

> It tries to make sure that the tty erase character matches the kbs
> definition in the terminfo entry for $TERM (in this case, 'screen').
> Screen's terminfo entry has kbs=^H, so the line 'stty erase `tput kbs`
> has the effect of telling your remote tty that the erase character is
> '^H', when what you're really sending it is '^?'.  Thus, vi will now
> only backspace on '^H' (since that is what the terminal _thinks_ the
> erase character is), and will echo '^?' just like any other character.
> 
> There are 3 possible solutions to this problem:
> 
> 1) Remove the above lines from your remote .bashrc file.
> 2) Remove the above lines from the remote /etc/bashrc file.
> 3) Change the remote machine's terminfo and termcap entries for screen.
> 
4) Travel back in time and fix the "screen" termcap entry
or
5) Fix screen to match its documentation and termcap

> If you have root on the remote machine, #2 is the correct solution.
...and break backspace it for other terminal types.

>   If
> not, #1 is the best way.
How can you remove them from .bashrc if they are located in /etc/bashrc ???


> I used #2 on all of the machines I admin, and I've never had this
> problem since.
> 
> -- 
> Ryan Jackson
> 
> 
> _______________________________________________
> screen-users mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/screen-users
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]