]> git.immae.eu Git - perso/Immae/Config/Ansible.git/commitdiff
Add bash history per tmux session
authorIsmaël Bouya <ismael.bouya@fretlink.com>
Tue, 13 Nov 2018 11:08:57 +0000 (12:08 +0100)
committerIsmaël Bouya <ismael.bouya@fretlink.com>
Sun, 18 Nov 2018 12:20:49 +0000 (13:20 +0100)
roles/shell/bash/templates/bashrc.j2

index 91334b735225dc28871d9604e50295011dda5901..fabe53fb5ec63f80d0a0529f23a2e1b8bb8ac9fd 100644 (file)
@@ -90,6 +90,11 @@ _tmux_dev() {
   done
 }
 complete -o filenames -F _tmux_dev tmux_dev
+
+if [ -n "$TMUX" ]; then
+  TMUX_SESSION_NAME=$(tmux display-message -p "#S")
+  export HISTFILE="$XDG_STATE_HOME/bash/tmux_${TMUX_SESSION_NAME}_history"
+fi
 ##### /Fretlink
 {% endif %}