Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Currently I have zsh set up in such a way that command history is shared between all sessions immediately.

Say I have a terminal emulator open with two tabs, each with a zsh session, A1 and A2. If I enter ls -la in A1, and then go to A2 and press up arrow key, I will see ls -la in the command prompt.

I would like to change it so sessions don't share the command history with each other although when you start new session it gets all the previous history from all sessions before it.

share|improve this question
add comment

1 Answer 1

Check out the available options to control history. I think you want

setopt append_history no_inc_append_history no_share_history

This is the default zsh setup, by the way.

You can save the history explicitly at any point with fc -AI and merge it back in with fc -RI.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.