107 posts
Posted 12 September 2013 - 02:20 PM
In a good buffer wrapper, it would be helpful to be able to set a Parent redirect object for the buffer to always copy to. This SHOULD default to whatever terminal is currently wrapped. I can't find a way to save that object. terminal.native just represents the unwrapped base computer screen and the storage variables for wrapping buffers within the "term" API seem to be local.
8543 posts
Posted 12 September 2013 - 02:25 PM
This is (unfortunately) unavailable.
107 posts
Posted 12 September 2013 - 08:46 PM
This is (unfortunately) unavailable.
Bummer. You of all people here would appreciate how useful that could be.
375 posts
Location
USA
Posted 12 September 2013 - 09:21 PM
An alternative is to detour the term.redirect function to save the redirect object in your own accessible scope.
107 posts
Posted 12 September 2013 - 09:24 PM
An alternative is to detour the term.redirect function to save the redirect object in your own accessible scope.
That has me thinking… Thanks.
8543 posts
Posted 12 September 2013 - 09:26 PM
If the point is to get the existing point of redirection when your code is started, overriding term.redirect won't help, since it will have already been redirected (or not) to wherever it's currently at when your code starts.
375 posts
Location
USA
Posted 12 September 2013 - 09:43 PM
Yeah, I should have noted that it really only works when run at startup. This is not a problem for a custom OS, but otherwise you'd need to restore the native terminal on program start. I'd say that isn't too bad of a deal for most environments.
107 posts
Posted 13 September 2013 - 01:09 AM
I've ended up just having the OS wrap term from _G. It's working quite well, any applications running will see their local buffer as term.native.