Networking, Programming and Graphics - Tutorials
ONLINEHOWTO.net Tutorials Category

Make Home, End and Delete keys work on FreeBSD

Type: Code Networking, Programming and Graphics - Tutorials
Networking, Programming and Graphics - Tutorials
Level: Beginner Networking, Programming and Graphics - Tutorials 
Networking, Programming and Graphics - Tutorials
Date: 2007-Oct-07
Networking, Programming and Graphics - Tutorials
Visited: 5555 times
Networking, Programming and Graphics - Tutorials
Rating: Networking, Programming and Graphics - Tutorials
Networking, Programming and Graphics - Tutorials
Published: Stephen Think

This tutorial will explain you how you can enable Home, End and Delete keys in ssh terminal of FreeBSD.

This configuration is not applicable for Linux distributions as all of them i have seen have these keys working by default.

The default environment for FreeBSD is CSH. You will need to open .cshrc file located in your home directory.

It should like this:
# $FreeBSD: src/etc/csh.cshrc,v 1.3 1999/08/27 23:23:40 peter Exp $
#
# System-wide .cshrc file for csh(1).
[root@onlinehowto ~]$ cat /usr/home/stefan/.cshrc
# $FreeBSD: src/share/skel/dot.cshrc,v 1.13 2001/01/10 17:35:28 archie Exp $
#
# .cshrc - csh resource script, read at beginning of execution by each shell
#
# see also csh(1), environ(7).
#

alias h history 25
alias j jobs -l
alias la ls -a
alias lf ls -FA
alias ll ls -lA

# A righteous umask
umask 22

set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin /usr/X11R6/bin $HOME/bin)

setenv EDITOR vi
setenv PAGER more
setenv BLOCKSIZE K

if ($?prompt) then
# An interactive shell -- set some stuff up
set filec
set history = 100
set savehist = 100
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
endif
endif

You need to add few lines in the if clause. Open this file with your favorite editor and after the bindkey lines add the lines bellow. To apply what you have done run this command.

[localhost]# source .cshrc
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
Rate this tutorial:                    
Post Comment


    • posted on 2009-Nov-02 | 12:50:55 PM
      yeah. thanks
Need a specific tutorial? Do not hesitate and submit a request!
Your e-mail: