Created
April 19, 2025 11:19
-
-
Save sudipidus/b136d6dd652892acf5decf08dad8029b to your computer and use it in GitHub Desktop.
Maintaining separate history for each tmux session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Often times I just want to run previous commands inside tmux sessions and keep a tab on what I was working just before | |
if [ -n "$TMUX" ]; then | |
# Get the tmux session name | |
session_name=$(tmux display-message -p '#S') | |
export HISTFILE="$HOME/.zsh_history_tmux_${session_name}" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment