Add search feature

Bug #960294 reported by Krzysiek Goj
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Sakura
Fix Released
Wishlist
Unassigned

Bug Description

In gnome-terminal one can press CTRL+SHIFT+F and search for text in terminal window.
Please, add this useful feature to Sakura.

David Gómez (dabisu)
Changed in sakura:
importance: Undecided → Wishlist
status: New → Confirmed
Revision history for this message
Chiu Yue Chun (brianon99) wrote :

I have been using Sakura for years and waited for "search" for a long time. I sometimes switch to termite just for this feature but honestly I love Sakura more. Recently I have implemented it myself so that I can stick with Sakura. Here is a patch.

https://gist.github.com/BrianOn99/8ec7b753b75678b727158f76f3da2159

Ctrl-Shift-F will open a dialog for search.

As I originally just write it for myself so it is not very well written. And I had almost no experience with GTK. I am here just to gather some feedback and if it is useful I am willing to improve it and contribute. Or the authors here can just take my code and improve it.

Revision history for this message
David Gómez (dabisu) wrote :

Thanks Chiu. Let me take a look at your patch, I'd like to add it.

Revision history for this message
David Gómez (dabisu) wrote :

The patch applied well, but at least for me the search isn't working. Does it work for you, Chiu? Also i see you added an item_search with the purpose to make it configurable. I don't think is necessary and that this feature can always be enabled.

Revision history for this message
Chiu Yue Chun (brianon99) wrote :

It works for me. Ctrl-Shift-F will invokes the search dialog. Do you mean the dialog does not show or it show but does not search?

Revision history for this message
David Gómez (dabisu) wrote :

It shows, but does not search. I mean, it doesn't highlight the result of the search, so I don't know if the search if successful or not.

Revision history for this message
Chiu Yue Chun (brianon99) wrote :

In my setup it is highlighted. Hmm... Chould you print lots of text in the terminal and then serch search some test that is scrolled away? For example, print the sakura AUTHORS file, the 4th line containing "Espinosa" should be scrolled away. Please search "Espinosa". In my setup the screen will be scrolled back and the word "Espinosa" is on the first line highlighted. Then we can know if the search is sucessful or not.

Revision history for this message
David Gómez (dabisu) wrote :

I followed your instructions, and no, it doesn't scroll back to "Espinosa", so its failing here. I'm going to look at the code and try to find the cause.

Revision history for this message
David Gómez (dabisu) wrote :

Ok, I think I've found the reason. I don't have PCRE properly installed and the call to vte_regex_new is returning NULL. I'm going to change the function to make it more verbose in case this happens.

David Gómez (dabisu)
Changed in sakura:
status: Confirmed → Fix Committed
Revision history for this message
Chiu Yue Chun (brianon99) wrote :

Nice to know the problem has been fixed. There is some rooms for improvement. Most importantly to add a button in the search dialog to go to the next text appearance. Is it OK?

Revision history for this message
David Gómez (dabisu) wrote :

Yes, it's ok. Let me know here when you make the changes. Please use the last version in the repository to make the patch.

David Gómez (dabisu)
Changed in sakura:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.