Add the following to a script in .config/i3/i3_shell.sh
#!/usr/bin/env bash
WHEREAMI=$(cat /tmp/whereami)
i3-sensible-terminal -cd $WHEREAMI
To call store the environment variable WHEREAMI
put
export PROMPT_COMMAND="pwd > /tmp/whereami"
precmd() { eval "$PROMPT_COMMAND" }
in your .zshrc
Then edit your i3config
to launch your new terminal
# start a terminal
bindsym $mod+Return exec $HOME/.config/i3/i3_shell.sh