Skip to content

Instantly share code, notes, and snippets.

@sudipidus
Created April 19, 2025 11:19
Show Gist options
  • Select an option

  • Save sudipidus/b136d6dd652892acf5decf08dad8029b to your computer and use it in GitHub Desktop.

Select an option

Save sudipidus/b136d6dd652892acf5decf08dad8029b to your computer and use it in GitHub Desktop.

Revisions

  1. sudipidus created this gist Apr 19, 2025.
    7 changes: 7 additions & 0 deletions dedicated-session-history-tmux.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    # 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