Problem
Currently, when colab drivemount requests Google Drive authorization, it outputs a long URL that the user must manually copy and paste into their browser. This manual step is tedious and prone to errors, especially when working within terminal emulators like Termux.
Proposal
Enhance the authorization workflow to automatically launch the authorization URL in the user's default system browser.
Implementation Idea
By detecting a system-level browser opener, the CLI can seamlessly bridge the gap between the terminal and the browser. A platform-agnostic approach could look like this:
import shutil
import subprocess
def open_url_in_browser(url: str):
# Support various platforms
openers = ["termux-open", "xdg-open", "open"]
for opener_name in openers:
opener = shutil.which(opener_name)
if opener:
subprocess.run([opener, url])
return True
return False
Benefits
- Significantly improves user experience by removing manual copy-paste steps.
- Makes the CLI feel more modern and integrated.
- Reduces friction during the initial setup/authentication process.
I have implemented this locally in my own environment, and it has proven to be a high-value ergonomic improvement. I would love to see this incorporated into the core CLI.
Problem
Currently, when
colab drivemountrequests Google Drive authorization, it outputs a long URL that the user must manually copy and paste into their browser. This manual step is tedious and prone to errors, especially when working within terminal emulators like Termux.Proposal
Enhance the authorization workflow to automatically launch the authorization URL in the user's default system browser.
Implementation Idea
By detecting a system-level browser opener, the CLI can seamlessly bridge the gap between the terminal and the browser. A platform-agnostic approach could look like this:
Benefits
I have implemented this locally in my own environment, and it has proven to be a high-value ergonomic improvement. I would love to see this incorporated into the core CLI.