Bug 365013 - Clicking 'save' offers something like /tmp/.mount_SPDYDZ/usr instead of $HOME
Summary: Clicking 'save' offers something like /tmp/.mount_SPDYDZ/usr instead of $HOME
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: 3.0
Platform: Appimage Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-02 18:15 UTC by tim-kde
Modified: 2017-11-21 11:47 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tim-kde 2016-07-02 18:15:52 UTC
I saved the appimage to my ~/bin directory. Running it either from xterm or through a launcher, saving a newly opened picture (no edits) offers /tmp/.mount_*/usr as the save directory instead of $HOME.

/tmp/.mount_whatever/usr doesn't exist, so at least I'm not saving things to /tmp by mistake.

Reproducible: Always

Steps to Reproduce:
1. Create a new document
2. Save it immediately to the default directory

Actual Results:  
The default directory doesn't exist. It's something like /tmp/.mount_SPDYXZ/usr

Expected Results:  
It should offer to save to $HOME
Comment 1 wolthera 2016-07-02 18:44:31 UTC
Yeah, this is true on Ubuntu 16.04 for me.
Comment 2 probono 2016-07-02 19:12:26 UTC
This is because AppRun inside the AppImage changes the working directory to usr/ inside the AppImage before executing the payload application. The reason is given in https://github.com/probonopd/AppImageKit/issues/172#issuecomment-229993161

Either Krita could specify to show $HOME in the open/save dialog, or a different AppRun without the chdir command could be used for the Krita AppImage.
Comment 3 tim-kde 2016-07-05 08:09:19 UTC
Perhaps the default location for saving files could be made a preference? $HOME is certainly better than a missing directory, but my $HOME is awfully cluttered - it'd be nice to be able to nominate $HOME/pictures/2016-Q2/ or something.
Comment 4 Halla Rempt 2016-07-05 13:15:20 UTC
Hum, actually the pictures directory should be the default.
Comment 5 Halla Rempt 2016-07-05 13:15:39 UTC
And there's also code to remember the last used folder. I'll investigate a bit.
Comment 6 Halla Rempt 2016-07-05 13:24:16 UTC
Argh, now I remember... Having the current working directory as the default directory for saving was added because people wanted to start krita from a terminal and have the the current directory as default save dir. So I guess we'd best fix the apprun command to not change the working directory.
Comment 7 probono 2017-11-20 07:31:30 UTC
This is fixed in linuxdeployqt which no longer uses an AppRun file nor changes the current working directory.

Alternatively, you can use any shell script as the AppRun file, as long as it is able to launch Krita.
Comment 8 Halla Rempt 2017-11-20 10:00:12 UTC
I really need to update our appimage build script... It's still basically what it was end of 2016.
Comment 9 Halla Rempt 2017-11-21 11:47:38 UTC
with 3.3.2, the appimage now shows $HOME by default.