XTerm

If you want just to have your console to look different? Follow this guide

.kshrc

If you want to let it work good and the best to see though, use .kshrc and do the following

add to your ~/.profile

export ENV="$HOME/.kshrc"

History file

If you want to let your history of commands be saved do the following

add to your ~/.kshrc

HISTFILE="$HOME/.ksh_history"
HISTSIZE=5000
alias __A=$(print '\0020') # ^P = up = previous command
alias __B=$(print '\0016') # ^N = down = next command
alias __C=$(print '\0006') # ^F = right = forward a character
alias __D=$(print '\0002') # ^B = left = back a character
alias __H=$(print '\0001') # ^A = home = beginning of line

Standart edit program

If you want your favorite editor to be also used at e.g. crontab, do the following

add to your ~/.kshrc

export VISUAL="<EDITOR COMMAND NAME HERE>"
export EDITOR="$VISUAL"

Colored PS1

If you want your text before where you execute your commands to look sth else (your PS1), then do the following

Linux like

add to your ~/.kshrc

export PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w \$\[\033[00m\] '

Just your own color with openbsd standart ps1

add to your ~/.kshrc

export PS1='\[\033[01;<COLOR NUMBER HERE>m\]\h\[\033[00m\]:\[\033[01;34m\]\w \$\[\033[00m\] '

where <COLOR NUMBER HERE> equals to one of the below named color codes:

  • 39 Default foreground color
  • 30 Black
  • 31 Red
  • 32 Green
  • 33 Yellow
  • 34 Blue
  • 35 Magenta
  • 36 Cyan
  • 37 Light gray
  • 90 Dark gray
  • 91 Light red
  • 92 Light green
  • 93 Light yellow
  • 94 Light blue
  • 95 Light magenta
  • 96 Light cyan
  • 97 White

Add the title bar to the PS1

if you want to get a n custom title on your ssh connection, do the following

Linux like

add to your ~/.kshrc

case "$TERM" in
xterm*|rxvt*)
    export PS1="\[\e]0;\u@\h: \w\a\]$PS1"
    ;;
*)
    ;;
esac

Openbsd like

add to your ~/.kshrc

case "$TERM" in
xterm*|rxvt*)
    export PS1="\[\e]0;\h: \w\a\]$PS1"
    ;;
*)
    ;;
esac

Language change

If you are originaly from an other land and you want your console to be translated (not fully but yeah), do the following

first find out if you language exists:

locale -a | grep "<The two characters of you language>"

then use that output (if there are multiply just choose 1 line) as your <CODE HERE>

add to your ~/.kshrc

export LANG=<CODE HERE>
export LC_ALL=<CODE HERE>

Colored ls

If you want colors in you ls use colorls, check here how to download it

install colorls: doas pkg_add colorls

add to your ~/.kshrc

alias ls='colorls -G'
export LSCOLORS=fxexcxdxbxegedabagacad

the LSCOLORS you can change to what ever you want, use this way:

Colors:
a     black
b     red
c     green
d     brown
e     blue
f     magenta
g     cyan
h     light grey
A     bold black, usually shows up as dark grey
B     bold red
C     bold green
D     bold brown, usually shows up as yellow
E     bold blue
F     bold magenta
G     bold cyan
H     bold light grey; looks like bright white
x     default foreground or background

The order of the attributes are as follows:
1.   directory
2.   symbolic link
3.   socket
4.   pipe
5.   executable
6.   block special
7.   character special
8.   executable with setuid bit set
9.   executable with setgid bit set
10.  directory writable to others, with sticky bit
11.  directory writable to others, without sticky bit

there are 22 chars in the LS_COLORS string.

the odd number characters are the foreground color and the even number characters are the background color.

The (nearly) linux like colorcode is the following: export LS_COLORS='ExGxxxxxCxxxxxCxCxBxbx'


Copyright (C) 2021 by Miniontoby <miniontoby@ircnow.org>