How do you make delete key work?

Polytropon freebsd at
Tue Jan 14 00:11:10 UTC 2014

On Mon, 13 Jan 2014 12:02:06 -0800, jungleboogie0 wrote:
> Hi All,
> Pretty simple question but I'm stumped.
> FreeBSD version:
> FreeBSD lylielion 10.0-RC5 FreeBSD 10.0-RC5 #0 r260430: Wed Jan  8 08:19:02
> UTC 2014     root at  i386
> Connecting via ssh with Zoc [0] and I'm trying to use the delete key in
> place of the backspace key with xterm emulation, but it displays ~
> characters and doesn't delete any characters.
> What terminal emulation do I need to use to make the delete key work?

I've been using the following approach for many years (last two
lines are important):

        if ( $?tcsh ) then
                bindkey "^W" backward-delete-word
                bindkey -k up history-search-backward
                bindkey -k down history-search-forward
        bindkey ^? delete-char          # for console
        bindkey ^[[3~ delete-char       # for xterm

To make this setting work globally, I've added it to /etc/csh.cshrc
in the interactive section - "if ($?prompt) then ... endif". This
should work across all terminal emulations. I've seen that FreeBSD 10
defaults to "xterm" in /etc/ttys. I don't know if this also works
in text mode where "cons25l1" has been the setting for my region...

The delete key now works as expected. :-)

This of course applies to the C shell (csh, tcsh).

If you're using bash, you might need other settings. But I'm
quite confident that the default settings should work.

Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

More information about the freebsd-questions mailing list