From: Ismaƫl Bouya Date: Tue, 13 Nov 2018 11:08:57 +0000 (+0100) Subject: Add bash history per tmux session X-Git-Tag: v1.0~16 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=bfe7d9cb1f547161cb7c7f4924c62c6ef819e4d7;p=perso%2FImmae%2FConfig%2FAnsible.git Add bash history per tmux session --- diff --git a/roles/shell/bash/templates/bashrc.j2 b/roles/shell/bash/templates/bashrc.j2 index 91334b7..fabe53f 100644 --- a/roles/shell/bash/templates/bashrc.j2 +++ b/roles/shell/bash/templates/bashrc.j2 @@ -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 %}