Welcome to Vifm Q&A, where you can ask questions about Vifm usage. Registration is optional, anonymous posts are moderated. GitHub or Google logins are enabled.
0 votes
in vifm by

I use tmux and the resurrect plugin to restore sessions with a set of windows after a reboot. At the same time, the vifm opens, but with folders that were most likely opened in the last vifm in which I worked.
Question. How can I make each of the 10 open vifms in a separate tmux window remember the folders that were opened in it?

1 Answer

0 votes
selected by
Best answer


You probably want to make use of sessions (see the docs). Each instance should have its own session specified on command line like:

vifm -c "session mysession"

resurrect should remember arguments passed to commands and thus name of a session. You might want to make session name dependent on some kind of tmux window/pane id via a shell alias to not assign names manually.

Having savedirs in 'sessionoptions' should be enough, but you can add more things to make more state session-specific.

edited by

Thank, you.
I made a new fish function:

function vifm-tmux
    set tmux_session "$(tmux display-message -p '#S')"
    set tmux_vindow "$(tmux display-message -p -F '#{window_index}')"
    set session_val "$tmux_session"_"$tmux_vindow"
    command vifm -c 'session '$session_val