now these scripts can not execute self-remove-operation "del %0" and never deletes from temporary files directory
What operating system version, what version of Geany?
Geany 1.28, Windows 7 SP1
I guess here: https://github.com/geany/geany/blob/1.28.0/src/build.c#L1084
What do you mean by "now"? IIRC we never cared about CRLF or LF for this script and nobody ever reported such problems. That doesn't mean there isn't a bug there but I personally consider it unlikely to be related to the line endings. I personally tested self-deletion of the script quite a lot and usually it works.
Probably the left geany_run_script_XXXXXX.bat scripts are caused by something else.
Closing popup console window by pressing [x] instead of "press any key" preventing "del %0". This:
str = g_strdup_printf("cd "%s"\n\n%s\n\n%s\ndel "%%0"\n\npause\n", working_dir, expanded_cmd, (autoclose) ? "" : "pause");
generate "pause" before "del %0" and "pause" after "del".
fix: **str = g_strdup_printf("cd "%s"\n\n%s\n\ndel "%%0"\n\n%s\n", working_dir, expanded_cmd, (autoclose) ? "" : "pause");**
Nope. It might fix the issue of not deleting the run script but it causes the console window to be closed immediately and so the user has no chance to see any output.
I personally don't consider the described case of closing the console window using the [x] as a bug in Geany but rather an unsupported use case. In the console window there is clearly stated "press any KEY".
Furthermore, I'm not sure if it is what the OP originally meant.
I had issues with script deletion when the filename contains special characters (if the temporary directory contains those), because it ends up quoted and so the quotes we add manually break it (I think that's the reason).
Hmmm, after trying: ``` c:>set TEMP="c:\tmp\testfiles\issue1278\ÅÓ¿¼ÑÓ" c:>set TMP="c:\tmp\testfiles\issue1278\ÅÓ¿¼ÑÓ" c:>"\Program Files (x86)\geany\bin\geany.exe" ``` Executing a file doesn't work at all anymore: `21:38:10: Failed to execute "python "main.py"" (start-script could not be created: Datei »"c:\tmp\testfiles\issue1278\ÅÓ¿¼ÑÓ"\geany_run_script_A0N1QY.bat« konnte nicht angelegt werden: Input/output error)` ("konnte nicht angelegt werden" means "file could not be created")
Closed #1276.
In #1095 we changed the previous behaviour from creating a batch script on-the-fly to using a static batch script which is distributed with Geany and so doesn't need to be deleted. So we get no more stale run helper scripts lying around. Fix released in Geany 1.29.
github-comments@lists.geany.org