Bug 221726 - Session Finished With Non-Zero Status popup notification for bash exit 0
Summary: Session Finished With Non-Zero Status popup notification for bash exit 0
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: 0.9
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-07 23:32 UTC by M. P. Čtyři
Modified: 2011-07-20 14:07 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 2.8
Sentry Crash Report:


Attachments
trigger the notification only when terminal process finishes with non-zero exitcode (2.67 KB, patch)
2011-07-19 14:11 UTC, Jekyll Wu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description M. P. Čtyři 2010-01-07 23:32:21 UTC
Version:            (using KDE 4.3.3)
Compiler:          gcc 4.3.4 AMD64
OS:                Linux
Installed from:    Gentoo Packages

Steps to reproduce:
1. In System Settings, enable the "Session Finished With Non-Zero Status" notification popup for Konsole.
2. Open a BASH session in Konsole.
3. Cleanly close Konsole by issuing 'exit' to BASH.

Expected result:
No notification appears.

Actual result:
A notification popup appears: "program '/bin/bash' exited with status 0"
Comment 1 Jekyll Wu 2011-07-19 14:11:22 UTC
Created attachment 61984 [details]
trigger the notification only when terminal process finishes with non-zero exitcode

    I can reproduce this with 2.7.999 and I'm pretty sure there is bug in the code.

    The attached patch is a quick fix. Its main purpose is to point out the bug.

    Some thoughts about Session::done(int exitStatus)

    1). this slot is connected with signal QProcess::finished(int exitCode, QProcess::ExitStatus exitStatus).
        so the parameter name is misleading. It actually should be named as exitCode.

    2). _wantedClose is the root cause. It is initialized to false and  becomes true only when user close the session from menu . So if the terminal process finishes itself , '!_wantedClose || exitStatus != 0' is always ture, and the notification is trigged.

    3). _wantedClose is not a name clear enough . Is _userWantedClose or better?
Comment 2 Kurt Hindenburg 2011-07-20 14:07:27 UTC
Git commit b8b3f23723690cc67d38add4209a34c15c21b990 by Kurt Hindenburg.
Committed on 20/07/2011 at 15:53.
Pushed by hindenburg into branch 'master'.

Correct non-zero status notification such that it works.

The non-zero notification was being displayed for zero exit codes.

Thanks again to Jekyll Wu (adaptee@gmail.com) for patch and research.
BUG: 221726
FIXED-IN: 2.8

M  +3    -2    src/Session.h
M  +8    -9    src/Session.cpp

http://commits.kde.org/konsole/b8b3f23723690cc67d38add4209a34c15c21b990