geany creates and leaves around copies of geany_run_script.sh
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Geany |
Unknown
|
Unknown
|
|||
geany (Ubuntu) |
Fix Released
|
Low
|
Unassigned |
Bug Description
repro steps:
1. geany a.py
2. press F5 to run it
3. it shows a terminal with some error and asks user to press ENTER to close the terminal
4. instead press CTRL-C
Actual:
geany how aborts geany_run_script.sh execution so that the last line nevers gets run (the last line is "rm $0" because the user is never supposed to even know that geany_run_script.sh is being created, it's an implementation detail).
Expected:
geany should never leave copies of geany_run_script.sh around
Note #1: I use geany for tons of stuff.... I did a quick search in my home dir and found tens of copies littered all over, in all kinds of dirs. they are just junk, I don't want them there.
Good news is that the fix is easy, the "rm $0" command just needs to execute before the terminal window waits for the ENTER key stroke.
The following patch does exactly that:
diff -r -u geany_apt_
--- geany_apt_
+++ geany_apt/
@@ -944,7 +944,7 @@
#else
str = g_strdup_printf(
"#!/
- \n\n%s\nrm $0\n", cmd, (autoclose) ? "" :
+ \nrm $0\n%s\n", cmd, (autoclose) ? "" :
"\necho \"Press return to continue\"\n#to be more compatible with shells like dash\ndummy_
#endif
Related branches
Changed in geany: | |
status: | Triaged → Confirmed |
Changed in geany: | |
status: | Confirmed → Fix Released |
On Tue, 2009-03-24 at 21:50 +0000, martin wrote: clean/geany- 0.16/src/ build.c geany_apt/ geany-0. 16/src/ build.c clean/geany- 0.16/src/ build.c 2009-02-10 22:10:50.000000000 +0100 geany-0. 16/src/ build.c 2009-03-24 22:41:19.000000000 +0100 sh\n\n% s\n\necho \"\n\n- ------- ------- ---\n(program exited with code: $?)\" \ var=\"\ "\nread dummy_var"); sourceforge. net/support/ tracker. php?aid= 2710482 sourceforge. net/support/ tracker. php?aid= 2710482
> Public bug reported:
>
> repro steps:
> 1. geany a.py
> 2. press F5 to run it
> 3. it shows a terminal with some error and asks user to press ENTER to close the terminal
> 4. instead press CTRL-C
>
> Actual:
> geany how aborts geany_run_script.sh execution so that the last line nevers gets run (the last line is "rm $0" because the user is never supposed to even know that geany_run_script.sh is being created, it's an implementation detail).
>
> Expected:
> geany should never leave copies of geany_run_script.sh around
>
>
> Note #1: I use geany for tons of stuff.... I did a quick search in my home dir and found tens of copies littered all over, in all kinds of dirs. they are just junk, I don't want them there.
>
> Good news is that the fix is easy, the "rm $0" command just needs to
> execute before the terminal window waits for the ENTER key stroke.
>
> The following patch does exactly that:
>
> diff -r -u geany_apt_
> --- geany_apt_
> +++ geany_apt/
> @@ -944,7 +944,7 @@
> #else
> str = g_strdup_printf(
> "#!/bin/
> - \n\n%s\nrm $0\n", cmd, (autoclose) ? "" :
> + \nrm $0\n%s\n", cmd, (autoclose) ? "" :
> "\necho \"Press return to continue\"\n#to be more compatible with shells like dash\ndummy_
> #endif
>
> ** Affects: geany
> Importance: Unknown
> Status: Unknown
>
> ** Affects: geany (Ubuntu)
> Importance: Undecided
> Status: New
>
> ** Bug watch added: SourceForge.net Tracker #2710482
> http://
>
> ** Also affects: geany via
> http://
> Importance: Unknown
> Status: Unknown
>
Your fix will still fail if the program goes into an infinite loop and
you terminate it. How about putting rm $0 at the beginning of the
script? Somewhere just after #!/bin/sh\n, but before %s.
--
Chow Loong Jin