this post was submitted on 30 Dec 2023
17 points (100.0% liked)

KDE

5287 readers
99 users here now

KDE is an international technology team creating user-friendly free and open source software for desktop and portable computing. KDE’s software runs on GNU/Linux, BSD and other operating systems, including Windows.

Plasma 6 Bugs

If you encounter a bug, proceed to https://bugs.kde.org, check whether it has been reported.

If it hasn't, report it yourself.

PLEASE THINK CAREFULLY BEFORE POSTING HERE.

Developers do not look for reports on social media, so they will not see it and all it does is clutter up the feed.

founded 1 year ago
MODERATORS
 

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.

Is it possible? Or do I have to make a project?

top 9 comments
sorted by: hot top controversial new old
[–] [email protected] 5 points 10 months ago (1 children)

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.

[–] [email protected] 2 points 10 months ago* (last edited 10 months ago) (1 children)

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:

{
  "name": "Genshin web cache",
  "files": [
    {
      "directory": "webCaches",
      "recursive": 1
    }
  ]
}

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

[–] [email protected] 2 points 10 months ago (1 children)

Well, in the documentation you linked, it says:

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...

[–] [email protected] 2 points 10 months ago (1 children)

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

[–] [email protected] 2 points 10 months ago (1 children)

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...? 🙃

[–] [email protected] 2 points 10 months ago (1 children)

Tried now, you're right! But then it navigates to the file I opened rather than keeping the view starting from that directory I chose:

I have to close the file and climb up the tree to get what I want the next time I open it T-T

[–] [email protected] 2 points 10 months ago (1 children)

Hmm, is this option checked?

You'll want to uncheck that...

[–] [email protected] 2 points 10 months ago

Ohhh, that did it! Thank you so much

[–] [email protected] 1 points 5 months ago

Update: this was kinda driving me insane again and I was about to write a bug report, but thankfully I didn't have to, because I found out while I was writing and doing some digging, that an option for this exists already! (oopsie)

Go to:

Settings > Configure Kate > Projects > Session Behavior

And check the box for "Restore Open Projects" to enable it, now when you reopen a session that had a folder opened in it, the folder will show up once again in the Projects view.