0

Normally saving new files goes into the contextually appropriate folder.

For example, when I use Sublime Text, and I click on one of the folders in my project in the sidebar, choose New file, then go to save that file with Ctrl+S, it should by default offer the folder on which i clicked, when asking me to enter the name of the new file.

But in Elementary, the default folder in which it offers to save the file in this case, will be the latest viewed folder that i had open the last time the file browser was used. So if i last opened a song from ~/Music, then it'll offer my ~/Music folder for saving the file from Sublime, regardless that that's not even inside my project.

And it doesn't seem to be the Pantheon Files' latest used directory... but the save/open dialog component itself. Like, if i were to browse to a file in my documents using Pantheon Files, let's say ~/Documents/file.txt, click on it to edit it in Code, then do Ctrl+Shift+S to save, it won't offer ~/Documents (where Pantheon Files was last pointed to), but it will open the last location of the open/save dialog (in my example, the ~/Music directory).

So I have no idea if this is even connected to Pantheon Files, or the save/open dialog uses something else, and I don't see anyone else complaining about this issue.

But how would i go about fixing this behaviour?

4 Answers 4

1

The file chooser stores its last used folder when it closes and re-opens in the same place initially. I do not think the file-chooser can itself determine the context of the calling app - it is up to the app to set the appropriate path by calling the set_uri () function. I notice that both Code and Photos suffer from the same problem. Looking code in Code, it use Gtk.FileChooserNative portal rather than a native Gtk.FileChooser and does attempt to set the path appropriately. I have a feeling that you cannot set the filechooser folder using the portal.

0

For Sublime Text I can recommend you to install via Package Control the AdvancedNewFile - it gives you the option to create new files into the folder location you are working in. I do not know what experince do you have, but without this package it always prompt me to save the file into the default folder location not only on elementary OS pantheon-files, but also using Nautilus in Ubuntu, it was the same long time ago with the sublime text (2) version I was using on Snow Leopard OSX.

0

There is a bug in Pantheon Files (which customises the filechooser) that contributes to this problem but it will be fixed in the next release. See https://github.com/elementary/files/pull/1136

0

This can be changed using Elementary Tweaks.In "Tweaks",click "Files" and turn off the option "Restore Tabs". Hope It Helps ;)

For Visual Reference: enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.