[Geany-Devel] Setting Windows working directory

Lex Trotman elextr at xxxxx
Wed Mar 13 06:19:51 UTC 2013

On 13 March 2013 17:01, Enrico Tröger <enrico.troeger at uvena.de> wrote:
> Hey,
>> We have had a report on IRC that running geany on the windows command
>> line will only open files in the Geany install directory unless you
>> use the full path.
>> eg C:\somepath> geany somefile.txt
>> will open installpath\somefile.txt not somepath\somefile.txt.
>> And with the "Open new documents from the command line" option set it
>> creates somefile.txt in the install dir since it doesn't exist there.
> Oops.
> Dammit, I broke this with the mentioned commit. After you said it, it is
> totally obvious.
> Well that change was a workaround at all but now we need another
> workaround. The problem is that some code, I don't remember exactly
> whether it were only plugins or also Geany code, read resource files
> from a relative path like "\data\foo.bar".

Shouldn't plugins use geany->app->configdir as the base directory as
per http://www.geany.org/manual/reference/structGeanyApp.html

and if its Geany it can use GeanyApp.datadir as the system data directory.

 For this to work, the working
> directory must be set correctly. The reason for the mentioned change was
> this in some plugin, so I've moved the code to change the working
> directory to perform it earlier in the init process, before loading plugins.
> For a quick'n'dirty fix we could either move the working directory
> change code move after command line parsing code but before plugin
> loading or we remember the working directory at early stage to use this
> when llater handling command line arguments.
> Both are not nice and the real solution is to get rid of relative paths
> for resources in the installation directory.
> I'm going to work on this.

Yes it would be better to keep the working dir, ... well ... the working dir :)

>> As the most experienced windowser (and the committer of that change)
>> could you look at it please?
> most experienced windowser?
> Really not. Using Windows once or twice a year, depending of the amount
> of Geany releases :).

Well, thats approaching infinitely more often than me (as my use
approaches asymptotically zero), Matthew is on holidays, and Colomban
denies knowledge of what Windows means :)


> Regards,
> Enrico
> --
> Get my GPG key from http://www.uvena.de/pub.asc
> _______________________________________________
> Devel mailing list
> Devel at lists.geany.org
> https://lists.geany.org/cgi-bin/mailman/listinfo/devel

More information about the Devel mailing list