Open tigerjack opened 7 years ago
I assume you have tried save_tabs_on_exit
and you didn't like it?
Yep. Apart from the bug I've already posted https://github.com/ranger/ranger/issues/883, it only works with one session at a time. It could be useful to have different sessions. Imagine as use case having multiple directories related to a specific project that I want to save/restore. Imagine now I'm working on different projects at a time. It could be great to me to have this kind of feature.
This is working well for me.
Create sessions file ~/.local/share/ranger/sessions with entries format: name:paths, eg:
util2:~/_util ~/_util
home2:~ ~
Create some aliases to use this file:
alias rf='echo ranger $(cat ~/.local/share/ranger/sessions | fzy | cut -d ":" -f 2) >/tmp/rlaunch && source /tmp/rlaunch'
alias rfn='echo ranger $(grep $(cat ~/.local/share/ranger/sessions | cut -d ":" -f 1 | fzy) ~/.local/share/ranger/sessions | cut -d ":" -f 2) >/tmp/rlaunch && source /tmp/rlaunch'
alias rr='rs $(tmux display -pt "${TMUX_PANE:?}" "#{window_name}")'
3. Use them like this:
rf - select session from fzy list, showing names + paths
rfn - select session from fzy list, showing names only
rr - launch session with same name as tmux tab
rs name - launch session "**name**"
ISSUE TYPE
RUNTIME ENVIRONMENT
EXPECTED BEHAVIOR
It could be useful to have a command to store the current opened tabs (the current ranger session) and to restore them later on. It could also be great to store them using a name, pretty much like tmux sessions. The aim is to have multiple sessions saved using different names and restore them at a later moment.
CURRENT BEHAVIOR
At the moment I can only save/restore one session at a time using F10.
CONTEXT
This could be useful for example when you have multiple ranger sessions. F.e. I can have different ranger sessions opened to manage different projects and I don't want to lose all the active tabs after a system reboot .
POSSIBLE SOLUTIONS
Maybe a file containing the working directories of each named session is enough. Ideally you have to press a key binding or execute a command to save the current session using a name. Later on, you can press another key binding to see the list of available sessions and restore one of them.