Subject: Re: Question about terminals and keys
To: Jan Danielsson <jan.m.danielsson@gmail.com>
From: Gilbert Fernandes <gilboooo@gmail.com>
List: netbsd-users
Date: 07/13/2006 18:54:40
>  Is this some terminal emulation issue? Is there any way to fix it?

You can make your shell and NetBSD be much more friendly on console.

First, get to Korn Shell. If your user is plop type this :

chpass -s /bin/ksh plop

Then, copy this to your .profile :

--- start of .profile

# korn shell config

PATH=$HOME/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/pkg/bin
PATH=${PATH}:/usr/pkg/sbin:/usr/local/bin:/usr/local/sbin
export PATH

EDITOR=vi
export EDITOR
PAGER=more
export PAGER

LC_ALL=C
export LC_ALL
LANG=en
export LANG
LC_CTYPE=en_US.ISO8859-1
export LC_CTYPE
# dash forces login shell on screen shell creation
# this is _not_ compatible with X Window
SHELL=-/bin/ksh
export SHELL
# same colors as default but folder is bright green
# instead of dark blue. easier to read.
LSCOLORS="2x5x2x3x1x464301060203"
export LSCOLORS

# part below is ksh specific since ksh
# is default shell for users

PS1='{$PWD}
[$LOGNAME][!] '

set -o emacs
bind '^I'=complete
bind '^I'=complete-list
set -o trackall
alias ls="colorls -GF"
--- end of profile

You will need to do a few changes, probably :)

First, I dont use X Window so my PATH does not contain what is required
for X Window. If you use it, insert a "/usr/X11R6/bin" in the PATH

Then, you have to configure your editor (vi or vim or whatever) and
locale correctly (I use a british keyboard and locale). Ask me in doubt
and I'll tell you (tell me what keyboard you have for example).

My SHELL is a bit special. I use a "-" in front of it, to tell screen
(GNU Screen) to start a login shell when I create a new shell
inside of Screen. If you do not wish to use screen, remove that -
in front of /bin/ksh

I also use colorls so I define two things : a new set of colors
(I only change folder color from default value) and ls is an alias
to colorls. You can install it by going in your pkgsrc
(cd /usr/pkgsrc/misc/colorls ; make install)

The last lines will give you a simple and nice prompt
(path followed on next line by shell number command history
and username) and activates the history so you can use
keyboard arrows for last commands.

Have fun,

-- 
unzip ; strip ; touch ; grep ; find ; finger ; mount ; fsck ; more ;
yes ; fsck ; umount ; sleep