Sublime Forum

Is there away to give prompt_open_file a starting directory?


Is there a way to give prompt_open_file a starting directory? I can’t find any documentation, and I’ve tried every option name I could think of…

I also tried doing a chdir() just before running the command, but it still starts in the directory that contains the file in the current view.

I’m sure I could create and open some dummy file in the destination directory and then close and delete it immediately afterwards (assuming I have write permission), but that would be a mess, and I’m looking for a better way.

I see this question was asked a few years ago in prompt_open_file command with default dir, but there were no responses.

1 Like


Not what you are looking for, but you can change the directory the save dialog is opened with using:

view.settings().set('default_dir', "/tmp")

Unfortunately this doesn’t work for prompt_open_file.

1 Like