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.
1 Answer 1
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
Marc Wilson
7,4891 gold badge16 silver badges20 bronze badges
-
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_EMACSset...)gidds– gidds2024年11月24日 09:07:22 +00:00Commented Nov 24, 2024 at 9:07 -
I disabled session support in
bashandzshyears ago.Marc Wilson– Marc Wilson2024年11月25日 21:19:46 +00:00Commented Nov 25, 2024 at 21:19
You must log in to answer this question.
lang-shell