-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[REQUEST] Remember tabs between sessions #241
Comments
Just an idea:
With that, the user can:
Additionally, the user can:
This second thing would also be really useful for me. There are certain directory-sets I often open at the same time. The command for opening tabs from a list could have an argument switch to choose if the current tabs shall be closed/replaced, or kept open (and the new dirs would open in additional tabs/appended). That would also allow to use any other source of dir-lists to open a corresponding tab-set. This solution would not include an “auto-save” when closing Joshuto though. Opinions? |
It sounds useful when thinking about the rofi script for managing sessions. However, it sounds like a bit of a pain from the development side (speaking for you and kamiyaa, as I don't know Rust), and overly complicated for new users to set up (they're already finding it dificult to figure out how to implement previews). If you decide to go the script route, maybe it's possible to ship joshuto with the scripts in the ~/.config folder by default? That way users would have it a bit easier to set up. Also I may be able to help with the documentation. Of course I'm just another user, so @kamiyaa's opinion is much more important. |
No, I don't think that this would be a particularly hard one. But thanks for the sympathy. 😉 ❤️
Hm, yeah. You have a point there. I might argue that this is not a very important feature that needs to work out-of-the-box, but still, you have a point there... But then maybe a more important question about the resulting user-workflow: You want that Joshuto open the last set of tabs automatically and every time Joshuto is started? For me, that would be super-annoying. I would - as a new user - expect to just see the working dir and in most cases, that's also the dir I'm interested in. (Beside the fact that I mostly have multiple Joshutos open and it would not help me personally at all to restore the tabs from the last closed session. That might be any random set of tabs...) In your idea, would there also be a tab for the working dir when starting Joshuto? So would Joshuto open with all tabs from the last closed session plus one for the cwd? I could maybe think about a |
Thinking about it, you're right. So, this is how I imagine how the feature could work now. This will probably be just expanding your initial idea more :P
This way: The command should open all directories that exist as tabs first, and then inform the user if there were problems (e.g some dir doesn't exist anymore).
I haven't really used other file managers, but ranger seems to always restore automatically ranger/ranger@b327b73. Also, they store their tabs in a stack and restore the oldest saved tabs first. |
I think that goes in a good direction. If I would pick this up (that would not be in the next ~6 weeks at least, maybe later... too busy and another Joshuto feature comes before in my mental queue - a nicer tab-representation in the top-bar), I would still clear my mind about a few details first. For example, I would like to avoid overly specific commands and command-arguments to Joshuto. Instead, I would like to add some "command chaining", so that a key-bindings can execute a sequence of commands. And I would like to add a general feature to provide various additional data as parameters to That would allow for keybindings like these: keymap = [
{
keys = [ " ", "s", "s" ], # session save
command = [
"shell save-session.sh {tabs}", # {tabs} gets substituted with the list of dirs of the open tabs
]
},
{
keys = [ " ", "s", "a" ], # session append
command = [
"shell pick-a-session-w-dmenu.sh",
"new_tab {stdout}" # {stdout} gets substituted with the stdout of the last `shell` command
]
},
{
keys = [ " ", "s", "r" ], # session replace
command = [
"shell pick-a-session-w-dmenu.sh",
"close_tab --all", # --all switch is missing and needs to be added
"new_tab {stdout}" # {stdout} gets substituted with the stdout of the last `shell` command
]
},
# With that, storing and saving to a default-file is trivial,
# and something like a dmenu/rofi tab-switcher now comes for free:
{
keys = [ " ", "t", "j" ], # tab jump
command = [
"shell pick-entry-w-dmenu-and-print-index.sh {tabs}",
"tab-switch-index {stdout}"
]
},
] So, your issue would be solved by a couple of more generic features, playing together. (This would also give a clean and easy base to solve #208 and if Joshuto would track the history of visited directories and can provide that as a parameter to Some details may come into our way though. For example, I'm not sure if implementing Not sure how much time all of that may need. My capacities are limited. 🙃 The execution of commands “on start” and “on quit” would be another feature to complete your use case. I don't think that I would take them up any time soon. Let's see.
Yes, with the logic above and by the law of simplicity, I would just stupidly open all tabs of that session.
Hmm, I just tried it quickly and at least there is no restore on startup by default. I personally think that handling this by configuration somehow as we discussed is good choice. Avoids feature creep. OK, these are just my thoughts. If I pick this up, I will add a little to-do list. |
Sounds good! |
Hey, sorry for not looking at this earlier! |
I like the idea that @DLFW proposed of chaining commands. It may also solve your issue @Sonico98 with opening specific directories. {
keys = [ "a", "b", "c" ],
command = [
"new_tab path/to/dir1",
"new_tab path/to/dir2",
"new_tab path/to/dir3",
"new_tab path/to/dir4",
]
}, or does this not cover your use case? @DLFW I can take on implementing command chaining if you are cool with that. |
Hi @kamiyaa!
I'm totally cool with that! Very much appreciated! 😊
Hm, if we only accept lists, yes. I don't know serde that well, but I guess it would be an option to allow both, a string or a vector of strings as command. I would guess that that's possible by using an enum there. One could also allow for Side note 1: Side note 2: Have fun! Looking forward to it! |
Yeah, good point. I'll keep that in mind
I think these two are kind of separate? One is mapping |
Hm, maybe it's just a knot in my brain. For me, the first is for defining custom-commands, currently just mapping |
It would be great if joshuto could remember which tabs were opened the last session, and restore them when opening the file manager again.
The text was updated successfully, but these errors were encountered: