Linux Home and End Keys
Linux Home and End Keys
Update ~/.profile
1 | export TERM=xterm-256color |
Print home and end Keys
1 | $ tput cols |
Bind in ~/.bashrc
1 | bind '"\e[1~":"\eOH"' |
Bind in ~/.tmux.conf
1 | bind-key -n Home send Escape "OH" |
tput utility
Color capabilities
- tput setab [1-7] – Set a background color using ANSI escape
- tput setb [1-7] – Set a background color
- tput setaf [1-7] – Set a foreground color using ANSI escape
- tput setf [1-7] – Set a foreground color
Text mode capabilities
- tput bold – Set bold mode
- tput dim – turn on half-bright mode
- tput smul – begin underline mode
- tput rmul – exit underline mode
- tput rev – Turn on reverse mode
- tput smso – Enter standout mode (bold on rxvt)
- tput rmso – Exit standout mode
- tput sgr0 – Turn off all attributes
Color code for tput
- 0 – Black
- 1 – Red
- 2 – Green
- 3 – Yellow
- 4 – Blue
- 5 – Magenta
- 6 – Cyan
- 7 – White
Print 256 colors
1 | printf '\e[48;5;%dm ' {0..255}; printf '\e[0m \n' |
1 | color(){ |