If a command running in the terminal needs to open a browser tab (such as to complete an OAuth flow), it usually uses xdg-open to open the URL. This does not work in a terminal running in JupyterHub because the user is not directly exposed to a graphical desktop. Is there a way to register JupyterHub as a handler of xdg-open, so that the URL is opened clientside?
For example, if I am using JupyterLab through JupyterHub, I open the terminal and enter xdg-open https://jupyter.org
, I get this output:
$ xdg-open https://jupyter.org
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: www-browser: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: links2: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: elinks: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: links: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: lynx: not found
/usr/bin/xdg-open: 851: /usr/bin/xdg-open: w3m: not found
xdg-open: no method available for opening 'https://jupyter.org'