[Kate] [solved] How do I make sessions save the chosen folder?
There's something I don't understand here: why when I do "Open Folder" and then save the session, closing it and opening it again I'm left with nothing?
Instead, if I open some files in subdirectories, the next time I reopen the session I'm just presented with the parent folders of those files, but I really needed to have the topmost directory to be able to access the whole tree structure whenever I reopen the session.
I haven't done much with sessions, but yeah, I do think, they only save the opened documents.
A project would certainly work for this. If you're using Git, it will auto-detect Git repos as projects, so personally I've never actually created such a project file myself (although reading through that documentation, there does seem to be some useful options there). This looks for example like this:
Alternatively, you can also use the File System Browser plugin. That one might be disabled by default, I'm not entirely sure. It gives you a little file-manager-like side panel, with which you can practically navigate through the entire filesystem:
The button I've highlighted with the red arrow, might also be hidden by default, but is really useful here, as it allows you to jump to the parent directory of the document you're currently viewing.
Thanks for the detailed answer!
The filesystem browser trick is pretty neat, but still I feel that this is less than ideal as I have to climb up the tree each time I reopen the session.
I also tried the "project" solution and it seems like it doesn't work as I expected it, for example I put a .kateproject file in the parent folder containing this:
I thought I'd find this project in Kate's welcome screen, but it's not there, am I missing something?
(very late) EDIT: I had made a mistake there, I placed the file in the wrong directory, it actually works as intended and I can see the file tree without issue in this way
By the way, I think this is worth opening a feature request for, it's way too hard to use for no apparent reason imo
The idea is that you never have to open a project manually, this is even not supported at all.
So, I'm guessing, you're supposed to re-open files by using a session, and then because those files are underneath a certain project, the project plugin will show the appropriate file tree from underneath the project file. Presumably, you could also have a session with files from multiple projects, for example.
And, to be honest, I'm not even sure, if Kate itself has a concept of a directory, or if this just exists in those plugins. I mean, it will have the concept of the "current working directory", like any process does, but I'm not sure, if you'd want to use that for this. You could, for example, be navigated into a different directory on the Terminal plugin than in the File System Browser plugin.
I mean, having a discussion with the maintainers is probably not a bad idea. I do feel like there's some edges that could be rounded with sessions in general, but yeah, all I'm saying is that there is probably a reason why it's like that...
You have a point, I should try again to get it to work first.
And, to be honest, I'm not even sure, if Kate itself has a concept of a directory
Is it possible that it doesn't? When I do "Open Folder" it does exactly that: open the folder and allow me to access all subdirectories and files within it, I feel like there is extra logic implemented to ignore directories as elements to remember and only count the files, but I don't know tbh, I'll be asking and see what they say
Hmm, yeah, interesting. Especially that it opens the directory in the Projects view rather than the file system browser plugin view (even if there is no .kateproject or .git/ in the directory).
I just had a bit of a play with it and, contrary to my expectation, it actually seems like the directory for the File System Browser plugin is remembered per session. That feels like it would actually be exactly what you're looking for...? 🙃