Bug 77837 - in kdevelop, console apps don't pause after execution
Summary: in kdevelop, console apps don't pause after execution
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Output Views (show other bugs)
Version: 3.0.2
Platform: FreeBSD Ports FreeBSD
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-17 16:12 UTC by Carl Glen Henshaw
Modified: 2004-12-11 00:20 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
proposed patch (365 bytes, patch)
2004-11-04 07:47 UTC, Michael Nottebrock
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Carl Glen Henshaw 2004-03-17 16:12:01 UTC
Version:           3.0.2 (using KDE KDE 3.2.1)
Installed from:    FreeBSD Ports
Compiler:          gcc 3.3 
OS:          FreeBSD

Under FreeBSD, when executing a C or C++ console application (like the "Simple Hello world application"), the konsole in which the app is executing closes immediately instead of waiting for a keypress. This makes it impossible to see the program output.

Apparently this is because the shell script that executes after the app exits:

/bin/sh -c '<program>; echo "Press Enter to continue!";read

is valid bash syntax. But for Posix sh, read requires at least one argument, eg "read var".
Under Linux the code works because /bin/sh invokes bash; but on FreeBSD /bin/sh invokes, well, sh.
Comment 1 Jason Dusek 2004-11-04 07:22:11 UTC
This bug makes me very unhappy. I almost bought Windows.
Comment 2 Michael Nottebrock 2004-11-04 07:47:52 UTC
Created attachment 8160 [details]
proposed patch
Comment 3 Alexander Dymo 2004-12-11 00:20:43 UTC
CVS commit by dymo: 

BUG: 77837
Thanks to Michael Nottebrock for the patch.


  M +1 -1      appoutputviewpart.cpp   1.31


--- kdevelop/parts/outputviews/appoutputviewpart.cpp  #1.30:1.31
@@ -104,5 +104,5 @@ void AppOutputViewPart::startAppCommand(
         cmd += "; echo \"";
         cmd += i18n("Press Enter to continue!");
-        cmd += "\";read'";
+        cmd += "\";read dummy'";
     } else
         cmd = program;