Re: gnome-terminal: "DEL"-key behaviour




On 01-Apr-99 Jens Lautenbacher wrote:

>> This does NOT work!
>> I too would like to know how to make:
>> 1) the delete key delete the character under the cursor and then stay in 
>>    position and not move backward like the backspace key.
>> 2) the backspace key delete by moving backwards, i.e. to the 'left'.
>> 
>> Where and how can you configure this.
>> 
>> Neither under SuSE nor under RH 5.2 have I been able to find a way to do
>> this in gnome-terminal/bash.
>> It works perfectly in for example gedit.
> 
> OK, but a terminal is a completely different thing. There are a lot of 
> places where different layers may change the meaning of the "what you
> press on your keyboard" and "what appears on the screen".
> 
> Even on a console (aka "text mode") there is libreadline (in the case
> of bash), termcap or terminfo and maybe the program itself which all
> can be tweaked (and must be tweaked) to get the desired behaviour..
> 
> under X there is at least the additional layer of X itself that may
> change what programs finally "see" from what you press on the
> keyboard. 
> 
> with other words: to make the terminal work right, you have to tweak
> bash/readline. gnome-terminal itself should be OK without the swapping 
> of DEL/Backspace set.
> 
> for example I have the following in my .bashrc
> 
> 
> bind '"\e[1~": beginning-of-line'
> bind '"\e[3~": delete-char'        ### this is on the console...
> bind '"\e[4~": end-of-line'        ### in X there will be no \e3~ sent 
>                                    ### for the DEL key. Yes, this is
> stupid
> 
> if [ $TERM = 'xterm' ]; then 
>    export PROMPT_COMMAND='echo -ne "\033]2;"`whoami`@`hostname`"\007"'   
>    bind '"\C-?": delete-char'      ### this is what under X will be seen
>    stty erase ^H
> fi

Jens, thanks for the long explanation but I know all this.
(You have to because RedHat has not got a neat out of the box solution
for these things like Debian and SuSE have)

I have got the same additions as you have (though I have implemented
them differently).
This works perfectly in xterm, i.e.
delete = delete under cursor
backspace = delete backwards
home = beginning of line
end = end of line

But `delete = delete under cursor' does NOT work in gnome-terminal
and it also does not work in Eterm (at least not for me).

-------------------------------------
Alexander Volovics
Dept of Methodology and Statistics
Maastricht University, Maastricht, NL
-------------------------------------  



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