Page 1 of 1

After Ctrl-B + enter set current directory for executed file

Posted: 2018-07-03, 11:38 UTC
by Lolly-Bob
Hi,

if I have many sub directories and want to find quickly a certain executable file I use Ctrl+B and then type in the file name or scroll to files with the wanted extension. If I click on that executable file it could happen that the program cannot be started, because it loads a dll from a parallel directory, but the current directory is not the directory of the executed file, so the dll cannot be found. I know it is a bad sample, but if I have a cmd or bat file and it starts on double click from a wrong directory I could destroy files. Many years ago I can remember I had a bat file with a deltree command and disabled inquiry. With Ctrl-B and enter I deleted the half of my hard disk.

So I think it woud be a good idea to set the current directory in Ctrl+B view to the directory of the executed file and it is saver. Perhaps you can support a switch to disable this setting.

Best regards

Posted: 2018-07-03, 13:50 UTC
by Dalai
Good suggestion. I wasn't aware that TC doesn't set the current directory to the one the launched executable is in (and I can confirm that behavior).

However, there's a workaround. Until this is implemented you can do the following: Press Ctrl+B to activate branch view, look for your executable and set the cursor on it, press Ctrl+B again and then press ENTER. I.e. one step more after setting the cursor and before starting the executable.

Regards
Dalai

Posted: 2018-07-03, 14:02 UTC
by Lolly-Bob
Thank you. I didn't know that yet. Very helpful.

Best regards

Posted: 2018-07-03, 20:30 UTC
by petermad
I wasn't aware that TC doesn't set the current directory to the one the launched executable is in
I wasn't either - and I think the current behaviour is dangerous - as Lolly-Bob also points out - this should definitely be changed!