The "Canc" key on my italian keyboard doesn't behave well on FreeBSD.

I'm using csh and "xfce4-terminal" :

root@marietto:~ # echo "$SHELL"
/bin/csh

and I've added bindkey ^[[3~ delete-char to ~/.cshrc ; but I didn't fix the problem. Now I don't have the tilde anymore,but pressing "canc" I don't have the same effect that I have using it on Linux. The "FreeBSD Documentation Project" tells that it is valid for xterm ; isn't xfce4-terminal like xterm ? how to fix ?
 
In an xterm, press ctrl-v then hit the "Canc" (Del?) button. See if it's the correct escape code.
 
when I press ctrl-v on xterm I see ^V and when I press Canc/Del,I don't see anything on the screen. That key don't work at all.
 
Does x11/xev show that the key is active? Maybe you selected a keyboard layout that disabled the key.
 
when I press Canc I see :
Code:
KeyPress event, serial 37, synthetic NO, window 0x4600001,
    root 0x765, subw 0x0, time 5083868, (97,310), root:(968,755),
    state 0x0, keycode 119 (keysym 0xffff, Delete), same_screen YES,
    XLookupString gives 1 bytes: (7f) ""
    XmbLookupString gives 1 bytes: (7f) ""
    XFilterEvent returns: False
 
when I press "CTRL V" :
Code:
KeyRelease event, serial 37, synthetic NO, window 0x4600001,
    root 0x765, subw 0x0, time 5171449, (414,290), root:(1285,735),
    state 0x4, keycode 37 (keysym 0xffe3, Control_L), same_screen YES,
    XLookupString gives 0 bytes:
    XFilterEvent returns: False
 
Ctrl-v is a special key combination, it allows you to view the next key "verbatim", in other words you can see the key's escape code or keycode.

Code:
state 0x0, keycode 119 (keysym 0xffff, Delete), same_screen YES,
That shows it at least registers as a "Delete" key, which is good.
 
ziomario said:
isn't xfce4-terminal like xterm ? how to fix ?

I can confirm that xfce4-terminal shows the same behaviour. With default settings pressing Delete (= Canc) inserts a tilde. You can make it behave like the Backspace key choosing 'ASCII DEL' under Preferences, Compatibility.
Being non-Italian and using csh I included bindkey "\e[3~" delete-char in ~/.cshrc with default settings in xfce4-terminal. Both Backspace and Delete work as expected now.
 
adding "bindkey "\e[3~" delete-char in ~/.cshrc worked,but it didn't choosing 'ASCII DEL' under Preferences, Compatibility.
 
Either one of the following two lines in your ~/.cshrc should have the same result:
Code:
bindkey "^[[3~" delete-char
bindkey "\e[3~" delete-char
The character sequence ^[ and the character sequence \e both represent the ESC character.
NOTE: ^[ is the caret-character followed by the character [

[...] I've added bindkey ^[[3~ delete-char to ~/.cshrc ; but I didn't fix the problem.

Question: Did you add this line to your ~/.cshrc exactly as shown and by typing a caret-character? :
Code:
bindkey "^[[3" delete-char
 
It worked for some time using bindkey "\e[3~" delete-char and then,suddenly it stopped working ; now I'm using bindkey "\e[3" delete-char and it seems to work great. But I don't know until when.
 
XFCE Terminal has it's own settings with regards to the 'Del' key. Some terminals have those features. Gnome Terminal for example has its own settings too. PuTTY (if you use that) also has some settings you can change. This mostly stems from the fact that the 'Del' key isn't exactly standardized (well, the problem is that there are different standards). Same for the backspace key. On some systems it's ^H on others it's ^?.
 
XFCE Terminal has it's own settings with regards to the 'Del' key. Some terminals have those features. Gnome Terminal for example has its own settings too.

I know,but as I said,the settings that u see on the picture don't work. Instead,it seems to work adding the setting bindkey "\e[3" delete-char inside the file ~/.cshrc
 

Attachments

  • Istantanea_2021-08-02_15-24-47.png
    Istantanea_2021-08-02_15-24-47.png
    41.4 KB · Views: 121
Instead,it seems to work adding the setting bindkey "\e[3" delete-char inside the file ~/.cshrc
Yes, you're going to need that too. I use a few definitions for 'Home' and 'End' too:
Code:
                bindkey "^[[1~" beginning-of-line # Home
                bindkey "^[[4~" end-of-line       # End
                bindkey "^[[3~" delete-char       # Del
Although I rarely use those keys, I've gotten accustomed to ctrl-a (beginning of the line) and ctrl-e (end of line).
 
So, should I add these both lines? (I'm not interested to bind Home and End too)
Code:
bindkey "\e[3~" delete-char
bindkey "\e[3" delete-char
 
Only the first one is valid. The entire escape code is <ESC>[3~. Yes, that ~ is part of it.
 
Back
Top