Konsole’s search tool

Following my konsole’s experiments from the past week I came here to show something that I’m working on with the VDG, This is the current Konsole’s Search Bar.

It works, It’s nice, It’s one of the few things I really like on konsole. It’s also full of little bugs that annoyed me for quite a while.

  • Opening / Closing the search bar in fullscreen cli applications (like midnight commander, htop, adom) can cause a crash because it resizes the terminal window
  • If you have a split you can find yourself in a position that the terminal search would not close
  • it sometimes can hold incorrectly be placed in the wrong part of the screen while opening
  • sometimes it would search in the wrong terminal screen
  • many small other ones.

I started to fix all of those bugs and discovered that most of them happened because we had *one* search bar that was shared between every terminal view, and whenever a terminal was activated we would reposition, reparent, repaint, disconnect, reconnect the search bar. Easiest solution: Each Terminal has it’s own search bar. Setuped only once.  The one bug I did not fix was the Opening / Closing one as the searchbar is inside of a layout and layouts would reposition things anyway.

All of the above bugs got squashed by just moving it to TerminalDisplay, and the code got also much cleaner as there’s no need to manual intervention in many cases. On the review Kurt – the Konsole maintainer – asked me if I could try to make the Search prettier and as an overlay on top of the Terminal so it would not reposition things when being displayed.



18 Responses to “Konsole’s search tool

  • Hi-Angel
    6 months ago

    > if I could try to make the Search prettier and as an overlay on top of the Terminal so it would not reposition things when being displayed. Thoughts?

    I’d prefer it to keep as it is now. On one hand, until you said Konsole repositions the text upon opening the bar, I never even noticed that. It is because text being lifted barely a few lines higher.

    On the other hand, an overlay would cover the text when text is either really long, or if people are using right-sided locale (like Persian, etc — granted, I dunno, whether they use terminal right-sided).

    But it’s just my subjective opinion.

    • Hi-Angel
      6 months ago

      Or, you know what? You can make the search bar transparent. Or even better: you can make it *very* transparent when not being focused, and become solid when someone focuses the bar, e.g. to type the text.

    • tcanabrava
      6 months ago

      Keeping as it’s now we freeze cli applications that don’t handle resize, they are too many to count.

      • Hi-Angel
        6 months ago

        Oh, sorry, I misunderstood this point “Opening / Closing the search bar in fullscreen cli applications” — I thought you meant, Konsole is crashing.

      • Please don’t move the search bar to the top right.

        There’s a reason the search bar is at the bottom, and it’s that that is where the text cursor is, and that is where your eyes are, so moving it to somewhere else than the bottom creates a breakage in where you have to look, i don’t think it would not make it work for me.

        I understand for some the broken cli applications may be so important that this minor inconvenience is acceptable, but there’s lots of us that don’t use them so this would feel like a regression.

        Maybe there’s another way to make the cli applications happy?

        • tcanabrava
          6 months ago

          I can let it in the bottom, right or left depending on the language. This is being actively discussed with the VDG so fear not.

  • I like the idea of the overlay. You can probably pop it on the left side for right-to-left languages. Bonus point if you can make it draggable, but that may open a whole new can of worms…

    (meta: would be great to make the text on your blog darker, it’s so hard to read right now, that I always edit the page with webinspector to turn that #999999 into black)

    • tcanabrava
      6 months ago

      color changed, feels better there?
      I’ll experiment with the draggable thing as I think this can fix some issues people may have.

  • Having one per instance sounds sane. Next, we need quadkonsole back; or a KDE version of terminator 🙂

  • Great, now we’d have a search bar which is

    – Harder to notice
    – Overlapping and therefore hiding actual content
    – Inconsistent with about every single other KDE app search

    Please don’t change such things just because you feel like it, this needs more thought, more agreement, rules to follow and then all applications adapting.

    Definitely a huge step backwards from the current search, please leave that as it is.

    • tcanabrava
      6 months ago

      hello Pawnie, before writting did you also read the number of bugs that the search bar fixes?
      I disagree with the “Harder to Notice” and the “Inconsistent with about every single other KDE app Search”, actually there’s no consistency there – every app does what it wants, and the visual design group is reviewing those changes with me so I don’t “change such things because I feel like it”.

      I would gladly change all applications for something like that as I use it in some programs already (like chrome, visual studio code, pyside and a few others) and I feel much more productive with that.
      but be assured: I’m not changing this because I like it, but because there are lots of terminal applications that just crash if you change the size of the terminal display.

    • Hi-Angel
      6 months ago

      Well, if he’s gonna make it transparent upon unfocused, as I suggested higher, it’d resolve the overlapping part.

      As for “harder to notice” — why do you even need to notice it? It’s not even there for starters, until you press the hotkey; and then once a sentence to search written, you won’t typically look back there.

  • Solerman Kaplon
    6 months ago

    I have no problem with the overlay, I seldon use that function and never with a simple app like htop or whatever. Give people prefer it at the bottom, could it be made an option? My second tought is: can’t the crash be fixed?

    • Hi-Angel
      6 months ago

      “The crash” as in, terminal apps are crashing, not the Konsole.

  • Josef Filzmaier
    6 months ago

    The most important thing to me is that the terminal window isn’t resized anymore upon opening the search bar, this is sometimes really annoying.

    I also like that the search bar is slimmer and don’t mind the fact that it is overlapping (as long as it is somehow ensured that *all* content is visible by scrolling or transparency or whatever).

    Thank you for your fixes on search! I do really use this feature regularly and got used to its bugs. Looking forward to the fixes!

  • > – Overlapping and therefore hiding actual content

    That, for me, is the biggest problem. It overlaps/hides part of the first line in each window. Exactly where commands are being entered in a ‘clean’ window. This has me immediately looking for a different console app!

    Please (re)enable relocation back to the bottom, along with tabs.

    • tcanabrava
      4 months ago

      if you are entering commands in a clear window, what would you search for?
      Not a joke, I really wanna understand the usecase.

      “This has me immediately looking for a different console app!”
      which one did you find that was good for your usecase?
      – Terminator can crash, and doesn’t display the searched word, only a line number (like Found at row 3133)
      – Gnome terminal has a popup and it essentially doesn’t work for searching
      – urxvt has no search

Leave a Reply

Your email address will not be published. Required fields are marked *