From 4c92b35b8d9bf9b9f13cc4ed8dfe150b1c83d2c2 Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Mon, 1 Feb 2021 20:23:14 +0800 Subject: [PATCH] bash & tmux: set TERM to screen-256color inside tmux --- bash/.bashrc | 4 ++++ tmux/.tmux.conf | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/bash/.bashrc b/bash/.bashrc index 3537661..447e4e7 100644 --- a/bash/.bashrc +++ b/bash/.bashrc @@ -12,3 +12,7 @@ PS1='[\u@\h \W]\$ ' if [ "$TERM" == "alacritty" ]; then exec tmux fi + +# Set TERM to screen-256color inside tmux +# (Needs tmux.conf changes) +[[ $TMUX != "" ]] && export TERM="screen-256color" diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf index 3fe3cc9..9096d72 100644 --- a/tmux/.tmux.conf +++ b/tmux/.tmux.conf @@ -1,6 +1,14 @@ +# Pretend to be screen-256color +set-option -g default-terminal "screen-256color" + # Allow mouse input (to switch window / panes) set -g mouse on +# Set new panes to open in current directory +bind c new-window -c "#{pane_current_path}" +bind '"' split-window -c "#{pane_current_path}" +bind % split-window -h -c "#{pane_current_path}" + # Tmux Plugin Manager # Note: Clone https://github.com/tmux-plugins/tpm to ~/.tmux/plugins/tpm first set -g @plugin 'tmux-plugins/tpm'