Open GrahamDumpleton opened 5 years ago
My guess at what is needed is to add to butterfly/escapes.py
an escape of:
@contextmanager
def url():
sys.stdout.write('\x1bP;URL|')
yield
sys.stdout.write('\x1bP')
sys.stdout.flush()
and then in function:
and one for URL
, which runs window.open(url, '_blank');
or similar.
Can then code up butterfly/bin/url.py
to use that.
The problem with this is how to do it so as to avoid popup blocker. :-(
Is it technically possible to implement a
b url
command that could communicate over the web socket back to the browser that the terminal is accessed using, and have the browser side code open the supplied URL in a new window/tab of the browser?If this was available, then one could create a fake script
xdg-open
and put it in thePATH
which actually calledb url
. That way Python applications that usewebbrowser.open()
, including theb open
command, or any other applications that tries to use a similar approach to open a URL in a browser, would be able to work where the terminal session is actually running on a remote system to the browser.If you think this is technically possibly and can provide pointers of how it could be integrated, then I can have a go at adding support for it. Thanks.