mirror of
https://github.com/prurigro/darkcloud-tmuxconfig.git
synced 2024-11-23 15:44:10 -05:00
bc1b3826f1
italics, and added an explanation of how and why this works to the README.
26 lines
922 B
Bash
Executable file
26 lines
922 B
Bash
Executable file
#!/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\""
|