zoomzoom
Guru
- Joined
- Sep 6, 2015
- Messages
- 677
Updated 2018.08.05: Added xterm-256color info
FreeBSD, by default, keeps file output on screen after a file has been closed, which is the opposite of how xterm operates in Linux, and if one prefers the Linux style of xterm, which clears file output from the screen once the file has been closed, perform the following:
Solution 1 (Recommended)
Create & apply a .termcap user file:
See termcap(5) man page for additional info
See this for xterm-256color difference, this for defining
Solution 2
Modify /usr/share/misc/termcap
Create & apply a .termcap user file:
- ~/.termcap
nano ~/.termcap
- Copy, then right click in the terminal to paste:Code:
xterm|X11 terminal emulator:\ :tc=xterm-clear: xterm-256color|xterm with 256 colors and clear:\ :Co#256:pa#32767:\ :AB=\E[48;5;%dm:AF=\E[38;5;%dm:tc=xterm-clear:\ :te=\E[2J\E[?47l\E8:ti=\E7\E[?47h::tc=xterm-clear:\ :tc=xterm-new:tc=xterm-clear:
- Save & exit:
[CTRL]
+[X]
,[Y]
, press[ENTER]
- ~/.profile
nano ~/.profile
- Add:
TERMCAP=$(< ${HOME}/.termcap); export TERMCAP
- Save & exit:
[CTRL]
+[X]
,[Y]
, press[ENTER]
- Reload terminal to apply:
source ~/.cshrc
See termcap(5) man page for additional info
See this for xterm-256color difference, this for defining
:te
& :ti
, and this for defining :tc
Modify /usr/share/misc/termcap
nano /usr/share/misc/termcap
- xterm
[CTRL]
+[W]
, type:xterm|
, press[ENTER]
- This should bring you to line 3013 Code:
3013: xterm|X11 terminal emulator:\ 3014: :tc=xterm-new: 3015: # :tc=xterm-r6:
- This should bring you to line 3013
- Change line 3014:
:tc=xterm-clear:
- xterm-256color
[CTRL]
+[W]
, type:xterm alias 3
, press[ENTER]
- This should bring you to line 2884 Code:
2884: xterm-256color|xterm alias 3:\ 2885: :Co#256:pa#32767:\ 2886: :AB=\E[48;5;%dm:AF=\E[38;5;%dm:tc=xterm-new:
- This should bring you to line 2884
- Change line 2886:
:AB=\E[48;5;%dm:AF=\E[38;5;%dm:tc=xterm-clear:\
- Add line 2887:
:te=\E[2J\E[?47l\E8:ti=\E7\E[?47h::tc=xterm-clear:\
- Add line 2888:
:tc=xterm-new:tc=xterm-clear:
- xterm
- Save & exit:
[CTRL]
+[X]
,[Y]
, press[ENTER]
- Rebuild termcap-database:
cap_mkdb /usr/share/misc/termcap
It also appears
[HOME]
, [END]
, & [DELETE]
keys lost their bindings in FreeNAS 11, and while these can be added back via ~/.termcap, it's simpler to add them to ~/.cshrcModify ~/.cshrc
nano ~/.cshrc
- Copy, then paste to
prompt
section:
Code:bindkey "\e[1~" beginning-of-line bindkey "\e[3~" delete-char bindkey "\e[4~" end-of-line
- Example:
Code:# Shell # #-------------------------------------- if ($?prompt) then set prompt = "[%{\033[34m%}%N%{\033[0m%}%{\033[32m%}@%{\033[0m%}%{\033[34m%}%m%{\033[0m%}] %{\033[34m%} %~$ set promptchars = "%#" set filec set history = 1000 set savehist = (1000 merge) set autolist = ambiguous set mail = (/var/mail/$USER) set autoexpand set autorehash bindkey "\e[1~" beginning-of-line bindkey "\e[3~" delete-char bindkey "\e[4~" end-of-line if ( $?tcsh ) then bindkey "^W" backward-delete-word bindkey -k up history-search-backward bindkey -k down history-search-forward endif endif
- Example:
- Save & exit:
[CTRL]
+[X]
,[Y]
, press[ENTER]
- Reload terminal:
source ~/.cshrc
Last edited: