fork-dev / TrackerWin

Bug and issue tracker for Fork for Windows
465 stars 10 forks source link

[BUG] Custom Commands Running Bash Scripts with "${file}" fail silently when file path contains a space and "Wait for Exit" is set to False. #2367

Open PConrad-NI opened 3 weeks ago

PConrad-NI commented 3 weeks ago

Running the latest version of Fork on Win 11.

I have a simple custom file command set up as a bash script...

echo "${file}" > /c/temp/debug.txt 2>&1

image

image

I'm currently working out of a .fork directory and I have the following setup.

image

If Wait for Exit is checked, running my custom command on any file yields proper expansion of ${file}

Debug file contents A: .fork/no-space-test/baz.txt Debug file contents B: .fork/space test/bar.txt

If Wait for Exit is not checked, running my custom command on any file with a path that has spaces will NOT yield proper expansion of ${file} and the script just dies silently without doing anything.

Debug file contents A: .fork/no-space-test/baz.txt Debug file contents B: !!! FILE IS NOT CREATED !!!

(This bug was very difficult for me to track down. I was interested in it because I was trying to find a way to get around some other issues such as trying to launch a script silently.)

DanPristupov commented 2 weeks ago

Yes, you are right. Good catch.

I fixed the problem and made a test build. Can you check if everything works properly now?

https://cdn.fork.dev/prerelease/Fork-2.2.12.zip

Extract the archive somewhere and run fork.exe.

PConrad-NI commented 2 weeks ago

Yes! It's fixed! Tested it with a longer path with multiple spaces.

.fork/New folder/New folder/New Text Document.txt

I am impressed with how fast you squashed this.