Version: 3.5.6 (using KDE KDE 3.5.6) Installed from: Unspecified Linux Compiler: gcc (GCC) 4.1.2 OS: Linux I try to compile directly C file of hello world which compile good from the console. I click on it in nautilus then "open with" and type gcc. And It not work. $ gcc hello.c [nadav@myhost C]$ ls a.out hello.c I also try to do it on Latex file and it is not work. The bug is also exist in Gnome: http://bugzilla.gnome.org/show_bug.cgi?id=414596
I found the problem, The open dialog don't change the execute directory to the current directory. I create a file with name g: _______________________________________________________________________ #!/bin/bash echo "The file is" $1 cd `dirname $1` gcc $1 echo "After execute gcc" exit 0 _________________________________________________________________ The $1 contain the full path, wthout the "echo "The file is" $1", The file not compile. The output from the gcc didnt appear in the output. ___________ How do I change the title of the bug? It should be the open with dialog not change to the current directory when it execute files from directories.
Maybe you add option to change to the current directory like the option to open in console.
Sorry without the "cd `dirname $1`" the file not compile
Thank you for the bug report and excuse us that it took us more than a year to reply. I'd like to clear some things out. First, > I click on it in nautilus then "open with" and type gcc. ...we don't care about nautilus, this is a gnome product. However, I *assume* you wanted to tell "konqueror" instead of nautilus there. Second, I guess you are just trying to open a *.c file with gcc. This should result in compiling the file if there are no problems. This is actually the most stupid thing you could ever do. You *should* use a console. That's because you need to see the error messages that the compiler may throw to the terminal. Anyway, if that's what you mean, you are damn right. Opening a file with gcc in a directory other than $HOME will place the generated executable in $HOME, just because konqueror sets the working directory to be $HOME always. I don't really know if this is intentional or not.... Anyway, can you confirm that I have guessed correctly? Thank you.
You guess correctly. I test it now and a.out file created in the home directory. Why does konqueror set the working directory to the home directory instead of the one he open?
three years later... Why not to set the working directory to the current directory? happen also in Dolphin
I can confirm the behaviour with 4.6.3
4 years later... i cant open binaries or scripts properly since they all execute in $HOME -.-
related: https://bugs.kde.org/show_bug.cgi?id=271824
(In reply to comment #9) > related: > > https://bugs.kde.org/show_bug.cgi?id=271824 That is not related at all. That is about whether the current working directory is set up properly. This one is about the selected file(s) path being passed to the script when using "Open With". Totally different issues.
Th(In reply to comment #10) > (In reply to comment #9) > > related: > > > > https://bugs.kde.org/show_bug.cgi?id=271824 > > That is not related at all. That is about whether the current working > directory is set up properly. This one is about the selected file(s) path > being passed to the script when using "Open With". Totally different issues. Correction: I meant the other bug was about directly executing the script by clicking on it vs using "Open With..." to execute it. Two different paths and not related to one another.
(In reply to comment #11) > Th(In reply to comment #10) > > (In reply to comment #9) > > > related: > > > > > > https://bugs.kde.org/show_bug.cgi?id=271824 > > > > That is not related at all. That is about whether the current working > > directory is set up properly. This one is about the selected file(s) path > > being passed to the script when using "Open With". Totally different issues. > > Correction: I meant the other bug was about directly executing the script by > clicking on it vs using "Open With..." to execute it. Two different paths > and not related to one another. In both cases the working directory doesnt seem to be set up properly. To me it is obviously related.
Is it possible to reopen https://bugs.kde.org/show_bug.cgi?id=271824 ?
(In reply to comment #13) > Is it possible to reopen https://bugs.kde.org/show_bug.cgi?id=271824 ? No. Like I said the problem might be the same (working directory not being set), but the code path is completely different. The cause for this bug is not the same as the one for 271824. Hence my comment about those two not being related. Anyways, I already have a potential fix up for review for this bug: https://git.reviewboard.kde.org/r/118954/
(In reply to comment #14) > (In reply to comment #13) > > Is it possible to reopen https://bugs.kde.org/show_bug.cgi?id=271824 ? > > No. Like I said the problem might be the same (working directory not being > set), but the code path is completely different. The cause for this bug is > not the same as the one for 271824. Hence my comment about those two not > being related. Anyways, I already have a potential fix up for review for > this bug: > > https://git.reviewboard.kde.org/r/118954/ Not that i am experiencing bug https://bugs.kde.org/show_bug.cgi?id=271824 .
> Not that i am experiencing bug https://bugs.kde.org/show_bug.cgi?id=271824 . Note* I am experiencing both bugs... And they are extremely annoying.
(In reply to comment #16) > > > Not that i am experiencing bug https://bugs.kde.org/show_bug.cgi?id=271824 . > > Note* > > I am experiencing both bugs... And they are extremely annoying. I cannot reproduce bug# 271824. The steps provided to reproduce that bug work correctly for me.
When you run a binary or script in dolphin that is in a subdir of $HOME what is your working directory? For me it is always $HOME.
I think the patch you made will fix both bugs though.
Git commit 89d4585c087daf9bdc17c4019af8065d23eb2d85 by Dawit Alemayehu. Committed on 28/06/2014 at 01:57. Pushed by adawit into branch 'KDE/4.13'. When executing commands set the working directory to be the current directory if not speified by the service. REVIEW: 118954 FIXED-IN: 4.13.3 M +8 -1 kinit/klauncher.cpp M +5 -2 kio/kio/krun.cpp http://commits.kde.org/kdelibs/89d4585c087daf9bdc17c4019af8065d23eb2d85
Git commit 0a5683cac4bc38e12eaa62966e37d8d208837662 by Dawit Alemayehu. Committed on 01/07/2014 at 11:35. Pushed by adawit into branch 'KDE/4.13'. Amended fix for #142957 to only apply to a local URL. REVIEW: 118954 M +3 -1 kinit/klauncher.cpp M +4 -1 kio/kio/krun.cpp http://commits.kde.org/kdelibs/0a5683cac4bc38e12eaa62966e37d8d208837662
Git commit e9026f008961fb654274d1da9308ee8d833300f4 by David Faure, on behalf of Dawit Alemayehu. Committed on 04/07/2014 at 21:13. Pushed by dfaure into branch 'master'. When executing commands set the working directory to be the current directory if not specified by the service. Forward port commit 89d4585 which fixes #142597. REVIEW: 119021 (David: s/KUrl/QUrl/ and .path() -> .toLocalFile()) M +10 -1 src/klauncher/klauncher.cpp http://commits.kde.org/kinit/e9026f008961fb654274d1da9308ee8d833300f4