2

I’ve tried editing /etc/bashrc_Apple_Terminal as well as adding files such as .bash_profiles, etc to my home folder but my session history keeps showing - when I open terminal, it will open 3 windows with its history. What to do? Thanks!

Edit: SHELL_SESSION_HISTORY=0 does not work as well

1
  • Adding SHELL_SESSION_HISTORY=0 to ~/bash_profile, (note there's no s on the end of profile as shown in your question), works for me with macOS High Sierra. You do have to either source the ~/bash_profile or close and reopen Terminal for the change to take. What version of macOS are you running? Commented Dec 30, 2018 at 16:31

1 Answer 1

1

If you want to discard your Terminal state, you have to quit with holding the Alt key. The menu will change from "Quit Terminal" to "Quit and close all windows".

enter image description here

You can also make it effective with the "normal" quit Cmd + Q, this way:

  1. Open your terminal
  2. Delete the content of the saved state folder: rm -rf ~/Library/Saved\ Application\ State/com.apple.Terminal.savedState/*
  3. Lock the folder: chflags uchg ~/Library/Saved\ Application\ State/com.apple.Terminal.savedState/
  4. Now, every time you quit your terminal, it won't be saved

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .