diff --git a/.bashrc b/.bashrc index 59b1334..d2ee157 100644 --- a/.bashrc +++ b/.bashrc @@ -92,11 +92,23 @@ alias lsblk='lsblk -o NAME,FSTYPE,SIZE,TYPE,MOUNTPOINT' alias nmap='sudo -E nmap' # I'm tired of managing weechat configs and multiple nicks -# Client depends: ssh, mosh, correct ssh host configuration -# Server depends: ssh, mosh, tmux, weechat, weechat.service (custom) +# Reference: https://wiki.thurstylark.com/Weechat.html # If you don't have weechat installed, connect to the existing tmux session through mosh [[ ! -s /usr/bin/weechat ]] && alias weechat='mosh vps -- tmux attach -dt weechat' # If you are thurstylark-vps, connect to the existing tmux session locally [[ "$HOSTNAME" = "thurstylark-vps" ]] && alias weechat='tmux attach -dt weechat' +chterm() { # Command wrapper to temporarily switch to screen-256color terminfo and back. + # This is unfortunately necessary because Debian has literally no package + # that provides tmux-256color terminfo, and I have to ssh into debian boxes + # all damn day. + local oldterm=$TERM + export TERM=screen-256color + tput init + printf "Terminfo is now '%s'\n" "$TERM" + $@ + export TERM=$oldterm + tput init + printf "Terminfo is now '%s'\n" "$TERM" +}