patrickb Hey! Quick request / question on very short notice. I'm writing a raku advent calendar post about PTYs and Terminal emulators. The prototypical terminal emulator I wrote includes an integration into Terminal Widgets. But currently it's a T-W patch so can't be released as such. This is so because I think it's currently impossible to externally add widgets to T-W. 11:09
japhb: Do you think it's possible to quickly hack something together so the terminal emulator T-W widget can be made work as a separate module - i.e. an externally provided widget? 11:11
This is meant as an open question. If this is not easily done or you don't have the time available, that's absolutely OK. The blog post can be made work without this as well. 11:12
13:19 librasteve_ left
japhb patrickb: Why wouldn't your widget work outside of the main T-W code base? 16:49
I have projects that have their own widgets and just inherit from T-W widgets, and Layout, StandardWidgetBuilder and so forth. 16:51
patrickb But they need to be integrated into the widget builder infra, right? 16:56
github.com/patrickbkr/Terminal-Wid...b9e5e08b73 16:59
that's the T-W patch that I'd like to move to it's own module. But it modifies StandardWidgetBuilder and Layout. 17:01
Inheriting and modifying The widget builder and layout prevents mixing different "plugin" modules. 17:02
japhb Oh I see what you're saying. You want to have an ecosystem of 3rd-party modules that all get picked up. 17:03
patrickb I'd like to just `use T-W` and then `use Terminal::Widgets::Plugin::TerminalEmulator` and then use it like it's a standard widget without having to subclass anything. 17:04
Well, get picked up whenever I `use` them.
japhb Yeah, fair. How much time do I have to figure this out?
patrickb The blog post isn,t written yet and I haven't merged all the pty stuff in moar libuv and Rakudo yet. :-P 17:05
well the post is 2/3 written and thdPRs are all ready. But still. 17:06
let's see where the last free spot in the calendar is.
japhb So ... if I figured out something that auto-searched for all Terminal::Widgets::Plugin::* modules, would that be too much? (I use something similar for MUGS)
patrickb I could claim 21st 17:07
My first idea would be to have some API to register plugins. Those plugins can then call that API and register themselves when `use`d 17:08
japhb Yeah, that's how MUGS works. :-)
patrickb Then you wouldn't need a global search on every startup 17:09
And you only import what you actually want to use.
So if I try to push the post out by 21st, I guess having this available on the 19th would be plenty enough time to finish everything up. 17:10
If this puts stress in your hristmas time, please don't bother. 17:11
japhb I think I've got a rough idea how to do it. I don't immediately have an answer for *lexical* registration on load, but *global* registration shouldn't be too hard. 17:28
It will take a couple days to get anything to you; part of today is already planned. 17:29
Geth Terminal-Widgets/main: 54323fc47e | (Geoffrey Broadwell)++ | 3 files
Add WrappableBuffer module and nano dependency
17:30
Terminal-Widgets/main: 1543d7d449 | (Geoffrey Broadwell)++ | 5 files
Rebase Log on WrappableBuffer and fix examples
japhb ^^ Pushing WIP (WrappableBuffer doesn't actually *wrap* yet) so that we're on the same page 17:31
OK, need to be AFK for a while. Will check back in later, though you may be asleep by then. 17:34
17:51 librasteve_ joined