Version: (using KDE KDE 3.4.0) Installed from: Compiled From Sources Compiler: gcc version 3.3.3 20040412 (Red Hat Linux 3.3.3-7) OS: Linux Starting Konsole. Opening Settings -> Configure Konsole. Go to "Session" tab. Enter any Name. Fill "Execute" field like that: ~/tools/open_ssh_to_smth OR any_error_command Click on Save Session. Click Ok. Close Konsole. Open it. And your new session silently ignored. It doesn't appear in "Session" menu. I thing there are two problems. 1) Konsole can't understand "~" in execute field. 2) Konsole silently ignores errors in "Execute" field. There must be some check about "execute" field contents.
And some more. If I save new session with name "123", with "~/tools/connect" in execute field and start Konsole with a command: konsole --type 123 ... everything works! It opens new session 123 and executes ~/tools/connect
Yes and yes... thanks for the info.
This has been fixed... Replace ~ with homeDirPath in Session's Exec entries. BUG: 102941 M +1 -1 konsole.cpp 1.526 --- kdebase/konsole/konsole/konsole.cpp #1.525:1.526 @@ -3069,4 +3068,5 @@ void Konsole::addSessionCommand(const QS } + exec = exec.replace( "~", QDir::homeDirPath() ); exec = KRun::binaryName(exec, false); QString pexec = KGlobal::dirs()->findExe(exec);
Hmm... that doesn't look right. ~ alone is $HOME but ~thiago should point to thiago's HOME. In other words: $ echo ~ /home/thiago $ echo ~thiago /home/thiago but: $ echo \~ | sed "s,~,$HOME," /home/thiago $ echo \~thiago | sed "s,~,$HOME," /home/thiagothiago
Well, something is wrong with using BUGS: and CCMAIL in CVS commits tonight: CVS commit by hindenburg: Try this again... expand ~ in Exec=~/script Qt/KDE needs a function for this. CCBUGS: 102941 M +13 -2 konsole.cpp 1.527 --- kdebase/konsole/konsole/konsole.cpp #1.526:1.527 @@ -3068,7 +3068,18 @@ void Konsole::addSessionCommand(const QS } - exec = exec.replace( "~", QDir::homeDirPath() ); exec = KRun::binaryName(exec, false); + + if ( exec.startsWith( "~/" ) ) { // ~/script + exec = exec.remove( 0, 1 ); // ~ + exec = exec.prepend( QDir::homeDirPath() ); + } else if ( exec.startsWith( "~" ) ) { // ~user/script + // FIXME: What do when ~user != ~ ? + // We could check that user == current user... blah! + kdWarning()<<"Unable to handle Exec=~user/ (use ~/ or full path): "<<exec<<" in "<<path.latin1()<<endl; + return; // ignore + } + QString pexec = KGlobal::dirs()->findExe(exec); + if (typ.isEmpty() || txt.isEmpty() || typ != "KonsoleApplication" || ( !exec.isEmpty() && pexec.isEmpty() ) ) @@ -3076,6 +3087,6 @@ void Konsole::addSessionCommand(const QS if (!path.isEmpty()) delete co; + kdWarning()<<"Unable to use "<<path.latin1()<<endl; return; // ignore - }
test - ignore
CVS commit by hindenburg: Use KShell::tildeExpand (thanks ossi). CCBUGS: 102941 M +2 -11 konsole.cpp 1.528 --- kdebase/konsole/konsole/konsole.cpp #1.527:1.528 @@ -109,4 +109,5 @@ Time to start a requirement list. #include <kaction.h> +#include <kshell.h> #include <qlabel.h> #include <kpopupmenu.h> @@ -3069,15 +3070,5 @@ void Konsole::addSessionCommand(const QS exec = KRun::binaryName(exec, false); - - if ( exec.startsWith( "~/" ) ) { // ~/script - exec = exec.remove( 0, 1 ); // ~ - exec = exec.prepend( QDir::homeDirPath() ); - } else if ( exec.startsWith( "~" ) ) { // ~user/script - // FIXME: What do when ~user != ~ ? - // We could check that user == current user... blah! - kdWarning()<<"Unable to handle Exec=~user/ (use ~/ or full path): "<<exec<<" in "<<path.latin1()<<endl; - return; // ignore - } - + exec = KShell::tildeExpand(exec); QString pexec = KGlobal::dirs()->findExe(exec);