From bfe7d9cb1f547161cb7c7f4924c62c6ef819e4d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Tue, 13 Nov 2018 12:08:57 +0100 Subject: Add bash history per tmux session --- roles/shell/bash/templates/bashrc.j2 | 5 +++++ 1 file changed, 5 insertions(+) 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 %} -- cgit v1.2.3