Sample Header Ad - 728x90

How can I force Terminal to have a persistent history per window open?

0 votes
2 answers
258 views
It seems a recent macOS X upgrade changed previous behavior in Terminal. (I'm currently on Sequoia 15.4.1) I'm used to having different windows opened with different settings (that can be defined in Terminal preferences). I use them to do different things, for example, one for default commands, one for man consultation, etc. Normally, Apple should keep a different history for each window. This is now broken. If I quit the app, the recent window history is lost when I reopen, and I have a common partial history. Specifically : - I start 3 windows with different colors, fonts and font size, size, and default directory - Each has zsh shell (standard Terminal behavior) - I don't close them except when quitting terminal. - If I restart each window has lost its previous shell history Hints for remedy ~/.zsh_sessions is a directory that stores each history session, but it seems the /etc/zshrc_Apple_Terminal file that should organize it has a bug. One hint is that a dedicated .history file per window is not created when one quits the app (only when a window is closed) It should be possible to add some lines to ~/.zshrc to force the right history to be created and reloaded. I wonder if anyone has already done the job?
Asked by Hugues (653 rep)
May 10, 2025, 01:30 PM
Last activity: May 13, 2025, 08:59 AM