Bug 167810 - Automatic cd-ing fails if you click on desktop
Summary: Automatic cd-ing fails if you click on desktop
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 16.12.2
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Peter Penz
URL:
Keywords:
: 174215 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-07-31 05:57 UTC by David Dempster
Modified: 2009-10-07 09:52 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Dempster 2008-07-31 05:57:10 UTC
Version:           1.1 (using KDE 4.1.0)
Installed from:    Ubuntu Packages
OS:                Linux

If you press F4 for the built-in terminal, "cd" commands are inserted as you navigate around.  (See http://bugs.kde.org/show_bug.cgi?id=161637 for a problem with that.)

However, I've noticed that if I click on one of my desktop icons, dolphin displays the current directory as "desktop:/code" instead of the usual "/home/david/Desktop/code".  Firstly, this is annoying because it's not part of the standard directory tree (meaning I can't click on the Up button to get "desktop:/" to "/home/david"), but that's not the bug I'm reporting.

The problem is that this sort of URL seems to inhibit the automatic cd-ing.  The current directory in the terminal remains "~", when I want to be in "~/Desktop/code".  The whole reason I use the embedded terminal is that I want the directories to be in sync.
Comment 1 Dario Andres 2008-08-01 00:24:45 UTC
I think Dolphin built-in terminal can't display the folder that you are in if you are browsing trought a kio-slave (like your "desktop:/folder").
I can reproduce this behaviour if I manually edit the location bar and put "desktop:/" in it: the terminal won't update its dir path (seems logical as kio-slaves dirs aren't real directories).
If I click the Desktop folder inside my Home folder, the built-in terminal display the path correctly.
I think that K/Ubuntu has something to do about using the "desktop:/" slave as default for browsing your desktop folder.
Comment 2 Peter Penz 2008-08-02 21:08:20 UTC
I can confirm the issue, but as Dario already said the terminal can only follow "real directories". I'm not sure whether there is an efficient way to get the "real directory" for a KIO slave working on local directories.
Comment 3 David Dempster 2008-08-03 04:26:32 UTC
But surely it is trivially simple to read the current URL ("desktop:/code") and substitute "$HOME/Desktop/" for "desktop:/".
Comment 4 Peter Penz 2008-08-03 10:03:53 UTC
> But surely it is trivially simple to read the current URL
> ("desktop:/code") and substitute "$HOME/Desktop/" for "desktop:/".

Sure, but this is a hack. The same problem has to be solved for other KIO slaves like settings:/ etc.
Comment 5 David Dempster 2008-08-03 10:24:39 UTC
Call it a hack if you like, but it would solve this bug.  Please do it.  You can make it more elegant behind the scenes later.

There are lots of hacks in Dolphin's terminal anyway.  When you open it, it is not in the right directory at first.  It quickly inserts a "cd" to put you in the right starting directory, and then sneakily inserts a "clear" so that you can't see it did that.  These two commands then clutter your bash history.

If the embedded terminal is essentially Konsole (I assume it must be), then I'd imagine that it would be possible for Dolphin to call it with something like "konsole --workdir $CORRECT_STARTING_DIRECTORY".  Presumably there's a reason that's not done.  I dunno... you're the programmer, not me.
Comment 6 David Faure 2008-08-10 09:32:51 UTC
Well, I see that konsole has a Session::setInitialWorkingDirectory nowadays, which could maybe
be used instead of the initial cd command [not trivial, since we create the part first and then change dirs].
However this wouldn't help with navigating into other dirs anyway, it would still put the cd+clear into
the history, I don't think there's much we can do about that. So I'm not sure it really matters that the
initial dir is done the same way.

Anyway, back to the original bug report, a simple mostLocalUrl call should fix it.
Comment 7 Peter Penz 2008-08-10 22:11:12 UTC
> Anyway, back to the original bug report, a simple
> mostLocalUrl call should fix it. 

Thanks David, I've added this to my TODO-list...
Comment 8 Dario Andres 2008-12-20 15:57:27 UTC
*** Bug 174215 has been marked as a duplicate of this bug. ***
Comment 9 Frank Reininghaus 2009-05-17 21:57:07 UTC
SVN commit 969265 by freininghaus:

Update the directory of the Terminal Panel if the current URL is not a
"file:" URL, but is nevertheless local (e.g., "desktop:").

This fix is also applied to the new "Open external Terminal" action
which will be in KDE 4.3.

BUG: 167810 


 M  +12 -1     dolphinmainwindow.cpp  
 M  +4 -2      panels/terminal/terminalpanel.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=969265
Comment 10 Frank Reininghaus 2009-05-17 21:59:48 UTC
SVN commit 969267 by freininghaus:

Update the directory of the Terminal Panel if the current URL is not a
"file:" URL, but is nevertheless local (e.g., "desktop:").

Fix will be in KDE 4.2.4.

CCBUG: 167810


 M  +4 -2      terminalsidebarpage.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=969267
Comment 11 Frank Reininghaus 2009-10-07 09:46:13 UTC
It turned out that my fix for this bug caused a rather annoying regression (bug 202176). This is now sorted out in trunk (which will become KDE 4.4 next year), but unfortunately, the real fix relies on new kdelibs functionality which cannot be backported to KDE 4.3.x.

Therefore, I will revert my change to TerminalPanel, which will make the "Automatic cd-ing" problem reappear in KDE 4.3.x, but fix the regression bug 202176, which appears to be more annoying to the majority of users.

I'm very sorry for the inconvenience, but it seems that there is no other way to resolve this before KDE 4.4.
Comment 12 Frank Reininghaus 2009-10-07 09:52:22 UTC
SVN commit 1032180 by freininghaus:

Revert the changes to TerminalPanel from r969265 in the 4.3
branch. This makes problems with "automatic cd-ing" in the Terminal
Panel reappear, but fixes a regression which caused a lot of trouble.

CCBUG: 167810
CCBUG: 202176


 M  +2 -4      terminalpanel.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1032180