Bug 302284

Summary: highlight the position of all found search results in the scrollbar, just like google chrome does
Product: [Applications] konsole Reporter: Delian Angelov <delian66>
Component: historyAssignee: kamisama <ujjus2001>
Status: RESOLVED FIXED    
Severity: wishlist CC: 4wy78uwh, adaptee, delian66, linds.r, nate, ujjus2001
Priority: NOR Keywords: usability
Version First Reported In: 2.8.3   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Delian Angelov 2012-06-21 07:51:04 UTC
Google Chrome does this in its search results, as well as seveAn example for the feature is described here:
http://www.techdreams.org/browsers/brilliant-google-chrome-ui-highlights-search-text-occurrences-on-scroll-bar/379-20080928

In summary - you search for something, and then you not only are transported to the first match, but the scrollbar actually shows the aproximate positions in the scroll buffer where all the matches are found. 

This allows feedback for:
1)whether there are any matches
2)aproximately how many they are
3)how they are distributed in the buffer



Reproducible: Always

Steps to Reproduce:
1. Open konsole
2. Make the scrollbar visible, if it is not already
3. Run for example 'for((i=0;i<10;i++));do ls -la /; done', so that there are several times more lines in the scrollbuffer, than currently visible in the konsole window.
3. Press Ctrl-Shift-F, and search for sbin for example.
Actual Results:  
The first 'sbin' match is highlighted in the konsole window. The scrollbar thumb should be repositioned, so according to the current window position in the scrollbuffer. The scrollbar background, however is NOT changed.

Expected Results:  
The scrollbar background should be striped, to highlight where are all the matches for the given search term (sbin).
Comment 1 Jekyll Wu 2012-06-30 08:01:14 UTC
I agree that is a good idea.
Comment 2 kamisama 2025-01-31 22:36:27 UTC
Hi, I agree that this would be a nice to have feature for Konsole. I've already started exploring the codebase and experimenting with possible implementations. I think I might be able to get this working.

Would it be okay if I work on this? Let me know if there's anything specific I should keep in mind while implementing it.

Thanks.
Comment 3 kamisama 2025-02-01 21:42:14 UTC
Edit: I have create a MR: https://invent.kde.org/utilities/konsole/-/merge_requests/1061(In reply to kamisama from comment #2)
> Hi, I agree that this would be a nice to have feature for Konsole. I've
> already started exploring the codebase and experimenting with possible
> implementations. I think I might be able to get this working.
> 
> Would it be okay if I work on this? Let me know if there's anything specific
> I should keep in mind while implementing it.
> 
> Thanks.

Edit: I have create a MR: https://invent.kde.org/utilities/konsole/-/merge_requests/1061
Comment 4 Kurt Hindenburg 2025-02-20 01:14:43 UTC
Git commit e389807d55060ef086722ea49d8b36d6264c8ebb by Kurt Hindenburg, on behalf of Ujjwal Shekhawat.
Committed on 20/02/2025 at 01:14.
Pushed by hindenburg into branch 'master'.

Implement scrollbar highlighting for search results

This PR introduces a feature to highlight the position of search results on the scrollbar, similar to how search results are highlighted in browsers like Google Chrome, editors like VSCode. The aim is to provide users with a visual indicator on the scrollbar, helping them quickly navigate through the results. 

M  +29   -0    src/SearchHistoryTask.cpp
M  +3    -0    src/SearchHistoryTask.h
M  +2    -0    src/profile/Profile.cpp
M  +4    -0    src/profile/Profile.h
M  +5    -0    src/session/SessionController.cpp
M  +2    -0    src/terminalDisplay/TerminalDisplay.cpp
M  +66   -2    src/terminalDisplay/TerminalScrollBar.cpp
M  +13   -0    src/terminalDisplay/TerminalScrollBar.h
M  +18   -0    src/widgets/EditProfileDialog.cpp
M  +3    -0    src/widgets/EditProfileDialog.h
M  +139  -100  src/widgets/EditProfileScrollingPage.ui

https://invent.kde.org/utilities/konsole/-/commit/e389807d55060ef086722ea49d8b36d6264c8ebb