Current directory is not respected

Bug #168119 reported by Yeti-dn
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Invalid
Low
Unassigned

Bug Description

Inkscape version: 0.44

Reproduction:

1. Run inkscape in some directory:
/home/me/my/new/project/figures$ inkscape

2. Draw something.

3. Select File -> Save As

Some strange directory (seems to be taken from the history of files edited
in the past) is offered for saving instead of /home/me/some/new/project.
There is no easy way to get to the current directory. This behaviour is
inconsistent with other programs.

Revision history for this message
Ezenu (ezenu) wrote :

Originator: NO

I investigated this a bit. It seems that the behavior is that when a user
saves a file, the path where they saved it is recorded in
~/.inkscape/preferences.xml:

    <group
       id="save_as"
       default="org.inkscape.output.svg.inkscape"
       append_extension="1"
       path="/tmp/inkscape" />

Then, whenever the 'Save as' dialog is loaded up again, this XML
configuration info is used to determine which directory path to use.

To me, it seems fairly logical that saved files go in the same place, but
then again I personally think that your proposed way (using current
directory) is preferable. This behavior may be the desired, working
behavior, I don't know.

By the way, I think the files which determine this are:
dialogs/filedialog.cpp and file.cpp

Revision history for this message
Yeti-dn (yeti-dn) wrote :

Originator: YES

> To me, it seems fairly logical that saved files go in the same place.

The same place as what? I mean, should explicit user change of the
directory in the dialog be the only way to change this place? The
directory preservation works strangely now -- for Open dialogs it does not
seem to work at all, I always get

(inkscape:30067): Gtk-CRITICAL **: gtk_file_system_unix_get_info:
assertion `g_path_is_absolute (filename)' failed

no matter what directory it has shown the last time, or whether I gave it
a file on command line (expecting following Open dialogs to start in this
file's directory). I have the same directory for "open" as for "save_as"
in preferences.xml, so this is probably a bug -- a separate one.

The goal is to be able to get to all interesting `the same places', namely
the same place you run the program from (for people running inkscape from
command line) and the same place I save stuff the last time (since it works
so now I suppose someone wants this).

If opening files (not just with the Open dialog, but also from Recent
Files and command line) changed to the file's directory (this is what I
expect), most of the cases when one cannot easily get to the last used
directory would be eliminated. The only remaining case would be when one
wants to save a new drawing into the same directory as the last time when
these two drawings are unrelated (i.e. the new one was not based on some
existing one, that would get us to its directory) and he does not have the
directory is Places (bookmarks), i.e. he probably does not use it really
often. In my opinion the need to get into `shell' current directory easily
overweights this.

Alternatively, the other directory could be offered in Places, though how
to do this without confusing people, I'm not sure.

Revision history for this message
Bryce Harrington (bryce) wrote :

Originator: NO

Hmm. Clearly this is a case where we have two different kinds of usage
models - people who start it from the cmdline would expect the default path
to be the cwd, but people who launch it from the application menu would
expect to see it use the stored preference.

At this point we need someone to propose an implementable solution which
can satisfy both usage models.

Ideas?

Revision history for this message
Johan Engelen (johanengelen) wrote :

Originator: NO

Idea: Commandline option
Add a commandline option that tells inkscape it was started from the menu.
E.g. "inkscape --default-dirs" or something similar. If --default-dirs is
specified, Inkscape will use the last saving path for the open and save
dialog. (Or maybe another default dir) Otherwise, cwd is used.

prkos (prkos)
Changed in inkscape:
status: New → Confirmed
Revision history for this message
Krzysztof Kosinski (tweenk) wrote :

--default-dirs is not necessary. We can check the TERM environment variable on Unix, and expand the solution now found in winmain.cpp for Windows.

Revision history for this message
Tim Holy (holy-wustl) wrote :

I'm glad to see a more recent comment on this bug, which is still present in the version shipped with Kubuntu Lucid. For me this issue is the only thing about Inkscape that I find truly annoying.

Revision history for this message
Elmar Zander (elmar-zandere) wrote :

For people working from the command line this behaviour is really a nuisance. I just overwrote 10 files, with a wrong version upon exporting to a different format, just because Inkscape used some old directory and neither my current directory nor the directory the files I opened resided in (which happend to be the same as my current dir). Luckily I have my stuff under version control. From the 100 other programs I use and regularly call from the command line none work like that. (Otherwise great program).

Revision history for this message
Olivier Ricou (inkscape1) wrote :

I do all using command line and Inkscape seems to be the only software under Linux which try to fight against that.

You don't have an idea of how many time I saved a file and I had to restart Inkscape to know where my file is since it was not in the current directory.

I think Inkscape has reduced my life expectancy each time I shooted because I tried to open a new file by typing "inkscape apple.svg", I get an error message and when I save it save it to "drawing.svg". Or because, when already running, I want to open files and of course the open file interface opens to a directory which is never the current directory so I have to click hundreds of times (at least) to come back to my current directory.

So please, please, please, add an option or whatever, but use current directory when inkscape starts from a term.

Revision history for this message
J Lorieau (justin-lorieau) wrote :

I would also like to see this fixed.

Revision history for this message
Olivier Ricou (inkscape1) wrote :

I made a new bug report since this one focuses on "Save as" which as now an option in Preference to use current directory. The new bug report, Bug #1155070, ask for a generalized use of current directory.

Revision history for this message
grey tomorrow (gtomorrow) wrote :

Closing because INVALID: FIXED. Files save to last used directory.

Tested on 1.0beta2 (074b463, 2020-02-02), macOS 10.12.6 (16G2136)
0.92.4 (5da689c313, 2019-01-14), MacPorts

If you feel this issue has been injustly closed, please feel free to open a new issue at http://inkscape.org/report . Thank you.

Closed by: https://gitlab.com/greytomorrow

Changed in inkscape:
status: Confirmed → Invalid
tags: added: bug-migration
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.