bash & tmux: set TERM to screen-256color inside tmux

This commit is contained in:
Peter Cai 2021-02-01 20:23:14 +08:00
parent 66c3eb9909
commit 4c92b35b8d
2 changed files with 12 additions and 0 deletions

View file

@ -12,3 +12,7 @@ PS1='[\u@\h \W]\$ '
if [ "$TERM" == "alacritty" ]; then if [ "$TERM" == "alacritty" ]; then
exec tmux exec tmux
fi fi
# Set TERM to screen-256color inside tmux
# (Needs tmux.conf changes)
[[ $TMUX != "" ]] && export TERM="screen-256color"

View file

@ -1,6 +1,14 @@
# Pretend to be screen-256color
set-option -g default-terminal "screen-256color"
# Allow mouse input (to switch window / panes) # Allow mouse input (to switch window / panes)
set -g mouse on 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 # Tmux Plugin Manager
# Note: Clone https://github.com/tmux-plugins/tpm to ~/.tmux/plugins/tpm first # Note: Clone https://github.com/tmux-plugins/tpm to ~/.tmux/plugins/tpm first
set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tpm'