On Sat, Oct 7, 2017 at 3:52 PM, Greg Reagle <greg.rea...@umbc.edu> wrote:

> On Sat, Oct 7, 2017, at 16:45, Mark Volkmann wrote:
> > The draft version of my article at
> > https://mvolkmann.github.io/fish-article/
> > has an open question which is:
> >
> > IIUC, fish maintains a separate command history for each session that
> > begins with the history of the session from which the new session was
> > created.
> > The command history is stored in ~/.local/share/fish/fish_history.
> > I don't see anything in that file that tracks the session in which the
> > commands were entered.
> > How does it manage to only recall commands that belong to the current
> > session?
>
> As far as I understand, it is not true that it "manage to only recall
> commands that belong to the current session".  Fish remembers commands
> from previous sessions.  In your article you have "How does this one
> file keep a separate history for each session?"  Why do you think that?
> I don't think it's true.
>

Here's what I did that made me think this:
- open a new fish session
- enter commands like "ls" and "date"
- open another new fish session from within the first
  (In my case I did this by creating a new tmux pane, not by just entering
"fish".)
- press up arrow to recall the last two commands and note that they are the
ones from the first session,
  so the new session is aware of those
- enter commands in the second session like "cd foo" and "cd -"
- press up arrow to recall the last two commands and note that these cd
commands are present
- switch to the first session
- press up arrow to recall the last command and not that it is not one of
the cd commands from the second session

So it seems that each new session starts with the command history of its
parent, but then maintains its own after that.
Is this wrong? Perhaps my use of tmux is the key to my misunderstanding.

-- 
R. Mark Volkmann
Object Computing, Inc.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to