Solved Delete Key

Hi everyone

I'm a complete Newb with FBSD, and even in Linux I just began about 4 Months ago.
Of course, I still run into simple problems, like the one here:

When I press the "Del" key on my keyboard (DELL) or "Home" key, I get a tilde "~" instead of working keys.

I have a complete fresh 12.x installation of FBSD.

Unfortunately I could not find a working solution so far here in the Forum nor on the Web.
Every time one explains something, I run into other issues, or there is missing a command with the explanati

But I wont let go BSD for now, so hope is to find help here.

Thanks in advance for any help
bratak
 

If those don't help solve it for you, add more details - shell you are using, user (root/other) and method of connection (ie. Putty from Windows, monitor and keyboard, ssh from Linux using xy terminal app...)
 
I presume that You are using the default shell (csh/tcsh). For the Del, Home, End, Insert keys to work You need to add the following in your .cshrc/.tcshrc file. e.g:
Code:
if ($?tcsh && $?prompt) then
        bindkey "\e[1~" beginning-of-line # Home
        bindkey "\e[7~" beginning-of-line # Home rxvt
        bindkey "\e[2~" overwrite-mode    # Ins
        bindkey "\e[3~" delete-char       # Delete
        bindkey "\e[4~" end-of-line       # End
        bindkey "\e[8~" end-of-line       # End rxvt
endif
 
I presume that You are using the default shell (csh/tcsh). For the Del, Home, End, Insert keys to work You need to add the following in your .cshrc/.tcshrc file. e.g:
Code:
if ($?tcsh && $?prompt) then
        bindkey "\e[1~" beginning-of-line # Home
        bindkey "\e[7~" beginning-of-line # Home rxvt
        bindkey "\e[2~" overwrite-mode    # Ins
        bindkey "\e[3~" delete-char       # Delete
        bindkey "\e[4~" end-of-line       # End
        bindkey "\e[8~" end-of-line       # End rxvt
endif


Thanks Minbari

Unfortunately, after using this code, something weird happened.
Every time I login, it throws me back to login:


From the "No such file or directory" message (3rd last line) I guess, I have a error in the code (handwritten because copy & paste was not working).
So I can't login anymore with root (which was the only user I had setup).

Then I started in "Single User Mode" with the intention, to correct my buggy code.
But the nano editor won't let me save the file: "Error writing .cshrc: Read-only file system

Aaaaand I'm stuck again... to learn something new? ;-)
Since it's a testing environment, its not a "problem", but I really would like to get it to work and use FBSD as my primary environment.

Any Ideas?
tnx

FOLLOWUP 1

I was able to mount the FS in write mode, after google it.
So I was editing the file, to correct my bug and it ended in a nightmare...
Every time I edited a word, or delete a character, or typed something, "it" started "it's" one live.
A character got deleted here, something got inserted there...
So no way for me to debug the file and I have no clue what's going on §8-/

However, thanks for your help and I will try it later when I'm in the "experimental" moode again.
bratak


FOLLOWUP 2

OK, I'm stubborn...so after a nice meal, I thought about how to attack this problem again.

1. I installed a new FBSD VM
2. I ssh'd into the FBSD VM via my raspberry pi
3. Copy & paste the code (that worked from my r-pi shell, but still not directly in the KVM-FBSD VM)
4. Reboot

Done & it works perfectly.

I still have no clue what the problem was with the wired behavior of the nano editing action.
However, now I can start over again and research FBSD further.

Thanks again to all the help here.
bratak
 
I've had this irritant for a while with just the [Delete] key on root's shell through several versions of RELEASE. Finally I was irritated enough today to go looking for the answer. This was the first search result I looked at and Minbari's answer was the clue I needed. I knew I needed a bindkey, just did not know the format I needed. Since the only key on this Logitech wireless keyboard that was misbehaving was that one key I just added the bindkey for delete to the .cshrc for root here:
Code:
if ($?prompt) then
        # An interactive shell -- set some stuff up
        set prompt = "%N@%m:%~ %# "
        set promptchars = "%#"
        set filec
        set history = 1000
        set savehist = (1000 merge)
        set autolist = ambiguous
        # Use history to aid expansion
        set autoexpand
        set autorehash
        set mail = (/var/mail/$USER)
        if ( $?tcsh ) then
                bindkey "^W" backward-delete-word
                bindkey -k up history-search-backward
                bindkey -k down history-search-forward
                bindkey "\e[3~" delete-char       # Delete
        endif
endif

To be complete the system in question is running:
Code:
# freebsd-version -kru
12.3-RELEASE-p1
12.3-RELEASE-p1
12.3-RELEASE-p2
 
Are there people for whom the delete key works out of the box with tcsh? Anyone? I understand that jumping through hoops is a time-honored FreeBSD tradition, but requiring users to provide a custom config for the bog-standard 101-key PC keyboard layout is just silly.
 
Never needed it. Backspace is right there.
But no. It does not work in a tcsh shell command prompt or Xorg terminal window.
Acts as Tilda key.

However under ee it does work as delete key.

Dont worry. Getting ready to ditch root tcsh for something else. No big change at all.
(sarcasm)
 
Back
Top