Summary: | Add search for tab functionality | ||
---|---|---|---|
Product: | [Applications] konsole | Reporter: | mchugh19 <mchugh19> |
Component: | tabbar | Assignee: | Konsole Developer <konsole-devel> |
Status: | REPORTED --- | ||
Severity: | wishlist | CC: | gabor, girard.nicolas, justin.zobel |
Priority: | NOR | Keywords: | junior-jobs, usability |
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Debian unstable | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Attachments: | Kate Ctrl Tab Video |
Description
mchugh19@yahoo.com
2012-04-25 02:55:22 UTC
Created attachment 132649 [details]
Kate Ctrl Tab Video
Video attached of kate's Ctrl Tab feature
Perhaps something similar to kate's Ctrl Tab feature could be used, I'm not sure if this feature is a KDE module/plugin to apps or if it's only in kate. But either way it could be used.
The following command allows the user to select a session by searching through the session names, and returns the number of the chosen session: qdbus $KONSOLE_DBUS_SERVICE /Windows/1 sessionList|xargs -I{} sh -c 'printf "%s\t" {}; qdbus $KONSOLE_DBUS_SERVICE /Sessions/{} org.kde.konsole.Session.title 1'|fzf --with-nth 2 |cut -d$'\t' -f1 The only missing piece here is the ability to switch to the tab associated with a session number via D-bus. I should add that, since `sessionList` only returns session numbers, we need to loop through all sessions to get their titles, which is awfully slow. A dedicated `sessionListWithTitle` method would be much needed for that purpose. > The only missing piece here is the ability to switch to the tab associated with a session number via D-bus. This would be achieved by fixing bug 422262. (In reply to Nicolas Girard from comment #4) > > The only missing piece here is the ability to switch to the tab associated with a session number via D-bus. > > This would be achieved by fixing bug 422262. I filed that bug when I wanted to achieve the same thing. Currently I have an awful workaround which activates the tabs one by one and gets the current title while it founds the searched tab. (In reply to Gabor from comment #5) > > I filed that bug when I wanted to achieve the same thing. Currently I have > an awful workaround which activates the tabs one by one and gets the current > title while it founds the searched tab. Yeah, I saw someone else getting that dirty here: https://debianforum.de/forum/viewtopic.php?t=178041 and didn't feel like trying. How bad does it feel with a few tens of tabs ? I might give it a try after all, if you don't mind pasting your code. (In reply to Nicolas Girard from comment #6) > (In reply to Gabor from comment #5) > > > > > I filed that bug when I wanted to achieve the same thing. Currently I have > > an awful workaround which activates the tabs one by one and gets the current > > title while it founds the searched tab. > > Yeah, I saw someone else getting that dirty here: > https://debianforum.de/forum/viewtopic.php?t=178041 and didn't feel like > trying. > > How bad does it feel with a few tens of tabs ? > I might give it a try after all, if you don't mind pasting your code. Here you have it: https://pastebin.com/7HFThb5a activates the tab if found else exits 0 Works with exact match, and I have not tried it more than about 10 tab. >
> Here you have it: https://pastebin.com/7HFThb5a
> activates the tab if found else exits 0
OK, so thanks to your input I tried `dbus-send` and adopted it as it seems roughly twice as fast as `qdbus`.
I took your "tab switch" loop from your code and incorporated into mine, reducing the sleep delay to 5ms.
I also revamped my code. The overall result is... well, not that bad for a temporary solution. It's crappy, but it does the job.
Since this has been pissing me off so long, and probably other people too, I think I'll create a proper repo on Github and put the code there.
> Since this has been pissing me off so long, and probably other people too, I think I'll create a proper repo on Github and put the code there. Done: https://invent.kde.org/ngirard/konsole-tab-switch I would agree having something like would be nice. The link in comment 10 looks like a nice alternative for now. |