Bug 162319 - Ability to search scrollback in KPart as in Konsole
Summary: Ability to search scrollback in KPart as in Konsole
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: kpart (show other bugs)
Version: 2.8
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
: 146286 207775 294204 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-05-19 18:32 UTC by erik_hahn
Modified: 2015-04-14 11:55 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.9.0


Attachments
The "Find" action in the context menu of konsolepart (28.74 KB, image/png)
2012-04-11 00:15 UTC, Jekyll Wu
Details
the searchbar in yakuake (202.21 KB, image/png)
2012-04-11 00:24 UTC, Jekyll Wu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description erik_hahn 2008-05-19 18:32:54 UTC
Version:           2.9.2 (using Devel)
Installed from:    Compiled sources
Compiler:          gcc 4.2.3 
OS:                Linux

In Konsole, you can search the Scrollback buffer with the Shortcut <Ctrl><Shift>+F or a menu item. This feature would be useful in Yakuake as well.
Comment 1 Eike Hein 2008-05-19 18:39:10 UTC
This must be implemented in the Konsole KPart component. Renaming & reassigning.
Comment 2 Robert Knight 2008-05-22 03:05:03 UTC
*** Bug 146286 has been marked as a duplicate of this bug. ***
Comment 3 Eric@Helsinki 2008-05-22 04:21:32 UTC
Seriously, there's no way somebody wants to implement the "grep" of the history by using a SIMPLE command? "up-arrow" or "shift + up-arrow" (to separate from the usual scrolling back). In bug 146286, I was told to use Ctrl+R... Mind the fact that I needed to move to a different prompt, select my input then come back to the console... Please, I beg you, move towards making this natural feature user-oriented and extremely simple. 
Comment 4 Robert Knight 2008-05-22 18:35:53 UTC
> Seriously, there's no way somebody wants to implement the "grep" of the history by using a SIMPLE command?

Eric, the command history is not part of Konsole.  It is part of the shell.  This bug report is about searching the scrollback, ie. the visual output on screen.
Comment 5 Alessandro Re 2008-05-22 19:20:31 UTC
Actually I think that a grep/find (but i'd appreciate more a grep) utility should be integrated in every component used in KDE that may contain a great number of lines. Like terminals, editors and so on.
Yeah, I know that's a "big thing" to do :) but I was just wondering that it may be implemented once, like a new kde text-area widget, and then used by everyone.
Thanks anyway for the job you all do.
Comment 6 Eike Hein 2010-10-07 17:13:06 UTC
*** Bug 207775 has been marked as a duplicate of this bug. ***
Comment 7 Jekyll Wu 2012-02-16 09:14:50 UTC
*** Bug 294204 has been marked as a duplicate of this bug. ***
Comment 8 Jekyll Wu 2012-04-10 00:22:00 UTC
So, this searching ability turns out to be most wanted feature of konsolepart :)

It is not hard to enable that ability in konsolepart. However, enabling it might introduce some problems for hosting applications(kate,dolphin,yakuake, etc).

The first problem is shortcut conflicting. Currently konsolepart always use its hardcoded shortcuts(see bug 196482). Enabling the searching ability will introduce three shortcuts: Ctrl+Shift+F for showing the search bar, F3 for next and Shift+F3 for previous. In hosting applications, F3 and Shift+F3 are commonly used for searching, while Ctrl+Shift+F is commonly used for "Full Screen Mode".

The second problem is visual inconsistency. This is mainly about yakuake, which has its own tabbar, skin and split system. The search bar looks odd in yakuake. 

So if this feature is added later, I'm inclined to make it accessible only through context menu, no shortcut available.

For those who are interested with this ability, you can fetch the experimental code from https://github.com/adaptee/konsole/tree/kpart-searchbar , play with it and leave your feedback here. 
Note, Qt 4.8 is needed to compile it. And be prepared it might crash your hosting applications.
Comment 9 James 2012-04-10 19:42:14 UTC
Wow!  Thanks very much for this feature, Jekyll!   I have never built a KDE app before, and do not see a Makefile in this one.  I see that it must be using cmake, but am unsure what steps are necessary to build.

Could you give me a quick walkthrough?

Thanks!
Comment 10 Jekyll Wu 2012-04-10 20:27:40 UTC
Oops, I should not assume that every user on BKO knows and enjoys compiling KDE programs :)

Basically, you just need to perform following steps after fetching and checking out the experimental code:

    $ cd konsole-code
    $ mkdir build
    $ cd build
    $ cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=debugfull ../
    $ make
    $ sudo make install

There is an another example at http://techbase.kde.org/Getting_Started/Build/Example

If you system does not have Qt4.8 yet, there is another branch https://github.com/adaptee/konsole/tree/kpart-searchbar-no-qt48, which does not require Qt4.8 .
Comment 11 James 2012-04-10 23:03:15 UTC
Thanks for the quick reply and excellent help, and many heartfelt thanks for the patch!

I was just able to successfully build both konsole & yakuake using the kpart-searchbar-no-qt48 branch!

The 'find' functionality is working beautifully!  Hooray!  \(^_^)/
(I have been wanting this search ability in yakuake for a very long time ;-D )

I was also able to build some Ubuntu .deb packages for these too for those that are interested.  At the moment I'm not sure what the package versions for them should look like in order to override the default ubuntu packages, but potentially be replaced in the future if this search capability is later merged into the upstream package.  

I can't decide if my proposed versioning (marked with '?' below) is good or not... any ideas?

INFO:
====

Binary Versions:
------------------------

    jcuzella@cirrus:konsole-git(kpart-searchbar-no-qt48)$ konsole --version
    Qt: 4.7.4
    KDE Development Platform: 4.7.4 (4.7.4)
    Konsole: 2.8.999
    
    jcuzella@cirrus:konsole-git(kpart-searchbar-no-qt48)$ yakuake --version
    Qt: 4.7.4
    KDE Development Platform: 4.7.4 (4.7.4)
    Yakuake: 2.9.8

Proposed konsole version: 2.8.5  ?

Current Ubuntu Package Versions:
--------------------------------------------------

    konsole (4:4.7.4-0ubuntu0.1)
    yakuake (2.9.8-1)

Proposed Ubuntu Package Versions:
-----------------------------------------------------

    konsole (4:4.7.4-0ubuntu0.2)  ?
    yakuake (2.9.8-1ubuntu1)  ?

(In reply to comment #10)
> Oops, I should not assume that every user on BKO knows and enjoys compiling
> KDE programs :)
> 
> Basically, you just need to perform following steps after fetching and
> checking out the experimental code:
> 
>     $ cd konsole-code
>     $ mkdir build
>     $ cd build
>     $ cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=debugfull ../
>     $ make
>     $ sudo make install
> 
> There is an another example at
> http://techbase.kde.org/Getting_Started/Build/Example
> 
> If you system does not have Qt4.8 yet, there is another branch
> https://github.com/adaptee/konsole/tree/kpart-searchbar-no-qt48, which does
> not require Qt4.8 .
Comment 12 Jekyll Wu 2012-04-11 00:11:50 UTC
Thanks for trying the experimental code.

Well, it is not really working beautifully, especially its appearance looks out of place in yakuake. You are just too excited :) . And the code is so primitive that it crashes your hosting applications under certain condition. So the experimental code is just for showing the idea and gathering feedback . Better not use it in your daily work.

I'll attach two screenshots so that those who are interested but don't want to bother with source code can get a general idea what it would look like (in yakuake).
Comment 13 Jekyll Wu 2012-04-11 00:15:17 UTC
Created attachment 70298 [details]
The "Find" action in the context menu of konsolepart

The hardcoded shortcut (Ctrl+Shift+F) for "Find" is likely to be removed in the real code
Comment 14 Jekyll Wu 2012-04-11 00:24:29 UTC
Created attachment 70299 [details]
the searchbar in yakuake

The searchbar is placed above other than below the terminal area. That is diffferent from stand-alone konsole. The basic consideration is yakuake has its own skinnable tabbar at the bottom, so putting the searchbar near the tabbar would make the visual inconsistency more outstanding.
Comment 15 Eike Hein 2012-04-11 07:42:51 UTC
Actually, I'd say the visual inconsistency isn't really a new problem - it's the same with scrollbars.
Comment 16 Jekyll Wu 2012-04-20 05:32:02 UTC
Git commit cce19d8cb859c1d0e3bc2f019f68aa9b864a87f2 by Jekyll Wu.
Committed on 20/04/2012 at 07:18.
Pushed by jekyllwu into branch 'master'.

Allow searching scrollback in konsolepart

No keyboard shortcuts are provided because they often conflict with
actions from hosting applications. The only way to use this searching
feature is from context menu
FIXED-IN: 4.9.0
REVIEW: 104608

DIGEST:

M  +1    -0    desktop/partui.rc
M  +3    -0    src/Part.cpp
M  +16   -11   src/SessionController.cpp

http://commits.kde.org/konsole/cce19d8cb859c1d0e3bc2f019f68aa9b864a87f2
Comment 17 James 2012-06-14 17:49:47 UTC
Jekyll,

I really appreciate the great work you did for the kpart-searchbar branch of konsole!  In my testing of both the kpart-searchbar-no-qt48, and kpart-searchbar branches while using yakuake, I encountered no bugs or crashes whatsoever!

Alas, Ubuntu has updated the konsole packages again to 4:4.8.3-0ubuntu0.1 and has overidden my locally built package.

Would it be possible to add this functionality to the master branch of konsole?
Comment 18 Jekyll Wu 2012-06-14 19:16:13 UTC
(In reply to comment #17)
> Jekyll,
> 
> I really appreciate the great work you did for the kpart-searchbar branch of
> konsole!  In my testing of both the kpart-searchbar-no-qt48, and
> kpart-searchbar branches while using yakuake, I encountered no bugs or
> crashes whatsoever!
> 
> Alas, Ubuntu has updated the konsole packages again to 4:4.8.3-0ubuntu0.1
> and has overidden my locally built package.
> 
> Would it be possible to add this functionality to the master branch of
> konsole?

James, please pay attention to the commit message in comment #16 and the status of this bug report( FIXED in 4.9.0). So the functionaity is already in the master branch and  KDE SC 4.9 betas.
Comment 19 Fabian 2015-01-14 09:29:43 UTC
This feature seems to be included now in yakuake, which is great. I've seen the search bar several times after slipping over my keyboard. But unfortunately I could never figure out the keyboard short cut I've pressed. It also doesn't appear in any configuration set. 
Can anybody here provide the shortcut? Of course I've tried Ctrl + Shift + F.
Comment 20 James 2015-01-22 07:35:58 UTC
Fabian,

At one point I had an older version of yakuake compiled with the keyboard shortcut in, but after updating yakuake my patch broke.  Since then, I no longer have the laptop I was using at the time.  Perhaps we could petition for the keyboard shortcut to be added.  I'm not sure that Ctrl+Shift+F, or Ctrl+F conflicted with anything that I was using at the time.
Comment 21 Fabian 2015-03-30 12:18:32 UTC
Hey James,
As I said, I have seen the search panel in the opensuse version of yakuake. So there seems to be a working implementation of this feature. But it is hidden like an easter egg.
Comment 22 Fabian 2015-04-14 11:55:14 UTC
I've just recognized the context menu entry 'Search...'. I've no clue at which version it was added. So this feature is implemented and works fine!