[Konsole-devel] [Bug 125977] When running 'konsole /path/to/script.sh', and script.sh doesn't exist, konsole complains about pseudo teletype

Kurt V.Hindenburg kurt.hindenburg at kdemail.net
Sun Apr 30 18:37:05 UTC 2006


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=125977         
kurt.hindenburg kdemail net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From kurt.hindenburg kdemail net  2006-04-30 20:37 -------
SVN commit 535934 by hindenburg:

Verify that the command is executable for '-e <command>.'

BUG: 125977


 M  +15 -2     session.cpp  


--- branches/KDE/3.5/kdebase/konsole/konsole/session.cpp #535933:535934
 @ -7,6 +7,9  @
 #include <knotifyclient.h>
 #include <klocale.h>
 #include <kprocio.h>
+#include <krun.h>
+#include <kshell.h>
+#include <kstandarddirs.h>
 
 #include <stdlib.h>
 #include <qfile.h>
 @ -146,8 +149,18  @
 
 void TESession::run()
 {
-//  kdDebug(1211) << "Running the session!" << pgm << "\n";
-  //pgm = "pine";
+  // Upon a KPty error, there is no description on what that error was...
+  // Check to see if the given program is executable.
+  QString exec = QFile::encodeName(pgm);
+  exec = KRun::binaryName(exec, false);
+  exec = KShell::tildeExpand(exec);
+  QString pexec = KGlobal::dirs()->findExe(exec);
+  if ( pexec.isEmpty() ) {
+    kdError()<<"can not execute "<<exec<<endl;
+    QTimer::singleShot(1, this, SLOT(done()));
+    return;
+  }
+
   QString appId=kapp->dcopClient()->appId();
 
   QString cwd_save = QDir::currentDirPath();



More information about the konsole-devel mailing list