mirror of
https://github.com/prurigro/darkcloud-tmuxconfig.git
synced 2024-11-23 07:34:10 -05:00
27 lines
922 B
Text
27 lines
922 B
Text
|
#!/usr/bin/env bash
|
||
|
|
||
|
SRC_TERMINFO="screen-256color"
|
||
|
TMP_TERMINFO="/tmp/${SRC_TERMINFO}.terminfo"
|
||
|
|
||
|
echo -n "Generating ${SRC_TERMINFO}-it... "
|
||
|
|
||
|
[[ -d "${HOME}/.terminfo" ]] \
|
||
|
|| install -d "${HOME}/.terminfo/"
|
||
|
[[ -f "${HOME}/.terminfo/s/${SRC_TERMINFO}-it" ]] \
|
||
|
&& rm "${HOME}/.terminfo/s/${SRC_TERMINFO}-it"
|
||
|
|
||
|
infocmp "$SRC_TERMINFO" | sed \
|
||
|
-e 's/^screen[^|]*|[^,]*,/'${SRC_TERMINFO}'-it|'${SRC_TERMINFO}' with italics support,/' \
|
||
|
-e 's/%?%p1%t;3%/%?%p1%t;7%/' \
|
||
|
-e 's/smso=[^,]*,/smso=\\E[7m,/' \
|
||
|
-e 's/rmso=[^,]*,/rmso=\\E[27m,/' \
|
||
|
-e '$s/$/ sitm=\\E[3m, ritm=\\E[23m,/' > "$TMP_TERMINFO"
|
||
|
tic "$TMP_TERMINFO"
|
||
|
|
||
|
rm "$TMP_TERMINFO"
|
||
|
|
||
|
[[ ! -f "${HOME}/.terminfo/s/${SRC_TERMINFO}-it" ]] && echo "Error!" && exit 1
|
||
|
|
||
|
echo -e "Done!\n"
|
||
|
echo -e "Now in your tmux.conf, change:\n\n set-option -g default-terminal \"screen-256color\"\n\nto:\n\n set-option -g default-terminal \"screen-256color-it\""
|