[Geany-Devel] Setting Windows working directory

Enrico Tröger enrico.troeger at xxxxx
Thu Apr 10 20:29:53 UTC 2014

On 18/05/13 16:12, Enrico Tröger wrote:
> Hey,
> sorry for the delay.
> On 19/03/13 17:55, Colomban Wendling wrote:
>> Le 19/03/2013 14:02, Enrico Tröger a écrit :
>>> On 16/03/13 18:23, Colomban Wendling wrote:
>>>> Le 15/03/2013 16:18, Nick Treleaven a écrit :
>>>>> On 13/03/2013 06:19, Lex Trotman wrote:
>>>>>> Shouldn't plugins use geany->app->configdir as the base directory as
>>>>>> perhttp://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:)
>>> Ok. Just to get it clear, do we want to not change the current working
>>> directory at all? Before my change we *did* change it very late in the
>>> init process. If we decide to not change it at all, we might lock again
>>> the directory where Geany was started as in bug #2626124.
>>> As Dimitar noted in this thread, this is not as bad and uncommon as I
>>> assumed. So if we all agree on this behaviour, I'd be ok with.
>> I don't care very much actually, but the idea of not locking the
>> directory from where Geany was started looks sensible.
>> Is there real issues on cwd()ing apart the option parsing one?
> Excluding the relative path resource loading problem, I don't know of any.
> So, we have two options here:
> a) remove the code to change the working directory on Windows
> completely, which would cause locking the directory from where Geany was
> started
> b) revert my faulty commit to the previous behaviour we had for years:
> changing the working directory at the end of the init process to not
> lock the original directory
> I personally would vote for b but don't mind much since most votes so
> far went for a). Just tell me what way to go and I'll change it.

I went for c):

in GIT master, Geany now changes the working directory after handling
files passed on the command line and before loading plugins.

So everything should be fine, at least it was my in tests.


Get my GPG key from http://www.uvena.de/pub.asc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.geany.org/pipermail/devel/attachments/20140410/951f715c/attachment.sig>

More information about the Devel mailing list