Closed mrieser closed 3 years ago
Can we determine whether or not we're launching from the command-line or not? If the app is launched via the GUI then I think we should set user-home as the current directory as I seem to remember some apps depending upon that, which I think is probably reasonable. But a command-line launch should definitely not overwrite that.
I just committed another recent PR which made the change to not change the working directory from the default value unless the WorkingDirectory
key is set, which I think is a bit safer since it uses the default.
If we want to get the user's home directory (independent of the sandbox folder, if any) we can use the UserHome java property.
When starting an application from the command line, it's important to have the current working directory properly set in order to access files passed with relative paths as arguments.
This was already once fixed in the past (see here and here), but it looks like the bad behavior slipped in in a merge. Considering there is even a todo-like review request, I guessed it's save to just delete the line and revert to using the proper working directory.