After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 591118 - zenity --progress cancel button doesn't return a value
zenity --progress cancel button doesn't return a value
Status: RESOLVED NOTABUG
Product: zenity
Classification: Core
Component: general
2.26.x
Other Linux
: Normal normal
: ---
Assigned To: Zenity Maintainers
Zenity Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-08-08 03:29 UTC by Jean-Philippe Fleury
Modified: 2010-07-28 10:44 UTC
See Also:
GNOME target: ---
GNOME version: 2.25/2.26



Description Jean-Philippe Fleury 2009-08-08 03:29:48 UTC
Note: this report has been previously done by a Launchpad's user on https://bugs.launchpad.net/ubuntu/+source/zenity/+bug/220656

On Gutsy with zenity 2.20.0-0ubuntu1 there is no code returned when the cancel button is clicked. There is an option --auto-kill that kills the parent process when used but that doesn't kill any child processes that may have started already and without the --auto-kill option nothing gets returned on the cancel button press so there is no way to handle the button press and kill the processes manually.

Example code :

mknod /tmp/pipe$$ p
        shntool split -f "$1" -o 'cust ext=mp3 lame --quiet - %f' -t "%n - %t" -d "$DirName" "$DirName/$FileName" \
        &> /tmp/pipe$$ | \
        (zenity --progress --pulsate --text="Splitting $FileName.\n Please wait until OK is active.") \
        < /tmp/pipe$$
        echo "$?"
rm /tmp/pipe$$

This code uses shntool to split an ape file based on its cue file which calls lame (for mp3 creation) and mac (for the ape file handling) as children processes. If the --auto-kill argument is used the program gets killed but the children processes lame and mac keep running. If not , cancel doesn't do anything at all. $? echoes 0 when everything is finished and ok is pressed.
Comment 1 Lucas Rocha 2009-08-08 09:55:10 UTC
Hmm, strange, if I simply do:

zenity --progress (press cancel here)
echo $?

I see 1 as exit code.
Comment 2 Luis Medinas 2010-07-28 10:44:30 UTC
I can't reproduce this problem (even in large scripts). Zenity reports always an exit code and it's common to loose the exit code when using complex bash scripts.
Closing as NOTABUG. 

Please reopen if you can reproduce when another snippet.
Thanks