Bug 77837

Summary: in kdevelop, console apps don't pause after execution
Product: [Applications] kdevelop Reporter: Carl Glen Henshaw <ghenshaw>
Component: Output ViewsAssignee: kdevelop-bugs-null
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 3.0.2   
Target Milestone: ---   
Platform: FreeBSD Ports   
OS: FreeBSD   
Latest Commit: Version Fixed In:
Attachments: proposed patch

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;