Sometime in the last week my Terminal stopped honoring the "New tabs open with: Same Working Directory" setting. Testing with "New windows ..." gave the same result.
My shell is zsh.
I was able to get this to work by following an answer here from Dan Rosenstark https://apple.stackexchange.com/a/340778/398648
# http://superuser.com/a/315029/4952
# Set Apple Terminal.app to resume directory... still necessary 2018-10-26
if [[ $TERM_PROGRAM == "Apple_Terminal" ]] && [[ -z "$INSIDE_EMACS" ]] {
function chpwd {
local SEARCH=' '
local REPLACE='%20'
local PWD_URL="file://$HOSTNAME${PWD//$SEARCH/$REPLACE}"
printf '\e]7;%s\a' "$PWD_URL"
}
chpwd
}
But: I do not know how I could have determined this for myself, or how I could have debugged a similar problem.
Any tips or tricks to figure out what those initial steps of Terminal are would be greatly appreciated.
Things that did not work:
- Toggling settings for New Tab or New Window
- Renaming or adding
return
at the first line of.zshrc
,.zsh*
files - All of the suggestions in Open new Terminal tab in current working directory doesn't work
Other potentially useful info:
- The "Same Profile"/"Default Profile" settings are honored when changed
- Adding
pwd
as the first line of.zshrc
shows the directory is already/home/<myuser>
- I have installed and uninstalled some tools and projects involving
nix
recently (includingnix-darwin
)
Metadata:
OS macOS Catalina 10.15.7 (19H2)
Terminal 2.10 (433)
zsh 5.7.1 (x86_64-apple-darwin19.0)