2

The ZSH sessions directory gets created in $HOME/.zsh_sessions. How can I change this directory's location ?

Haven't found anything searching on Google and DuckDuckGo.

asked Nov 23, 2024 at 18:04

1 Answer 1

3

You will need to change the location in /etc/zshrc_Apple_Terminal. From that file:

# Set up the session directory/file.
SHELL_SESSION_DIR="${ZDOTDIR:-$HOME}/.zsh_sessions"
SHELL_SESSION_FILE="$SHELL_SESSION_DIR/$TERM_SESSION_ID.session" 
mkdir -m 700 -p "$SHELL_SESSION_DIR"

Note that the script tries to use $ZDOTDIR as the location and $HOME if $ZDOTDIR is not defined. Change the location of the directory to where you want it to be.

answered Nov 23, 2024 at 18:40
2
  • Also note that that file seems to get overwritten with every macOS update, so you'll need to re-edit it each time. (After every update, I get Terminal errors in every new window until I fix the line in that file which assumes you have $INSIDE_EMACS set...) Commented Nov 24, 2024 at 9:07
  • I disabled session support in bash and zsh years ago. Commented Nov 25, 2024 at 21:19

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.