Bug 46233 - using bookmarks should clear command line first
Summary: using bookmarks should clear command line first
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Unclassified
Component: bookmark (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal with 20 votes (vote)
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-08-07 20:18 UTC by Ferdinand Gassauer
Modified: 2012-06-26 13:37 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.10.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ferdinand Gassauer 2002-08-07 20:05:27 UTC
(*** This bug was imported into bugs.kde.org ***)

Package:           konsole
Version:           1.2 Beta (using KDE 3.0.7 1 beta1))
Severity:          wishlist
Installed from:    compiled sources
Compiler:          gcc version 2.95.3 20010315 (SuSE)
OS:                Linux (i686) release 2.4.18-4GB
OS/Compiler notes: 

Hi!

using konoles bookmarks issues the command 
"cd <bookmark>"

if something is written on the commandline first the command above fails.

suggestion: issue CTRL-C to ignore all input on the current line and provide an emty line for the bookmark command.
cu
ferdinad




(Submitted via bugs.kde.org)
(Called from KBugReport dialog)
Comment 1 Stephan Binner 2002-08-25 14:57:56 UTC
Thank you for your bug report.
The feature that you requested has been implemented in the latest
development (CVS) version of KDE. The feature request will be closed.
Comment 2 Ferdinand Gassauer 2003-02-21 19:48:04 UTC
does NOT work in HEAD and KDE31_BRANCH any more 
Comment 3 Stephan Binner 2003-02-21 20:43:38 UTC
For a reason, it's now not broken anymore for all who have no emacs shell 
keybindings. 
Comment 4 Ferdinand Gassauer 2003-09-13 10:17:04 UTC
its still a problem in CVS 
I use bash - never used emacs  
 
after typing cd and hitting a bookmark I get 
gassauer@linuxfg3:~> 
cd cd '/d2/src/gassauer.cvs/kde2/' 
bash: cd: cd: No such file or directory 
 
Comment 5 Kurt Hindenburg 2004-12-28 04:43:58 UTC
I didn't understand Comment #3.

What is konsole to do if there is a program running on the current session?  Currently it sends the 'cd whereever' to that program.

How would it "clear" the command line?

I'm not sure konsole should do anything other than what it is doing now. 
Comment 6 Ferdinand Gassauer 2004-12-28 15:43:12 UTC
well it did it correctly before i issued the bug report

Comment 7 Kurt Hindenburg 2004-12-28 20:12:09 UTC
For reference:

00638void KBookmarkOwner::openBookmarkURL( constQString& url )
00639 {
00640   (void) new KRun(KURL( url ));
00641 }

So, KRun(KURL("file:///mnt/part6/build/kdebase/konsole/konsole/"));

Perhaps, overwrite 
void KBookmarkOwner::openBookmarkURL   (   const QString &   _url   )   [virtual]
to clear prompt and then call KRun ourselves...
Comment 8 Kurt Hindenburg 2006-08-03 19:41:18 UTC
http://mail.gnome.org/archives/mc-devel/2006-July/msg00013.html
http://mail.gnome.org/archives/mc-devel/2006-July/msg00063.html

Comments on mc trying to tell if there is anything currently on the command line.
Comment 9 Kurt Hindenburg 2010-04-26 03:50:11 UTC
See 161637 - think it is a bug, not wish.
Comment 10 Jekyll Wu 2011-09-21 02:47:39 UTC
Another issue is what to do when the foreground process is not a shell? Sending 'cd /path/to/folder'  or 'ssh ...' into vim/mc/less does not make sense and might cause damage. That sounds a stupid operation but I think some (new) users might do that, because the current documentation does not contain clear explanation on how bookmark works.


One possible way is checking which screen is in use: 
1). If the secondary screen is in use, the foreground process is not a shell. Do nothing in this case.
2). If the primary screen is in use, the foreground process may be a shell with high probability. Do something as suggested in this report in this case.
Comment 11 Kurt Hindenburg 2012-06-26 13:37:05 UTC
Git commit 693cecbae73896f03a1c47f4c41a0fa30759d917 by Kurt Hindenburg.
Committed on 26/06/2012 at 15:30.
Pushed by hindenburg into branch 'master'.

Clear command line before outputting bookmark entry.

Keep a list of valid programs (shells) that accept Ctrl+C to clear the
command line.  Clear command line only when there is no active program
running and a valid program is being ran.
REVIEW: 105298
FIXED-IN: 4.10.0

M  +12   -0    src/SessionController.cpp
M  +2    -0    src/SessionController.h

http://commits.kde.org/konsole/693cecbae73896f03a1c47f4c41a0fa30759d917