I'm using zsh in macOS 13.
I sometimes want to just try out a few things in Terminal without wanting to keep any history or log of these once I close the Terminal window/tab. On other occasions I do want to keep the history though. So I created two profiles in Terminal, History and No History and then I launch whichever I need. I've even given both distinct background colours so I know which window is for testing.
I initially thought I'd do that upfront via
set +o history under Preference > Profiles > Shell > Startup > Run, but that doesn't quite work.
I don't want to edit the
~/.zshrc because that'd mean no history for those occasions where I do want to keep the history.
I've also tried
HISTCONTROL=ignoreboth and then preceding each command with a space, meaning it won't get recorded, but that only seems to work in bash and it's only a workaround and not a solution anyway.
How can I keep no record / history for specified profiles once I close the Terminal window?