Code Monkey home page Code Monkey logo

Comments (1)

pranavAbe avatar pranavAbe commented on June 15, 2024

So, I've done some digging into this on my own, and as much as I would like to make a Pull Request, I'm not entirely sure how to test and make sure there isn't any missing logic that might break functionality. I'll leave my findings here so you can build them into the project if you're interested, but if you would rather that I try and make a Pull Request, I'll try my best to work on it and build this functionality into the project.

So there will be two new parameters that launch_ssh_cloudflared will take, namely, starting_directory="/content", and vscode_build=stable. The possible inputs for starting_directory is an absolute path on the Colab VM's filesystem (with the default being /content, which is the default starting directory for a Colab Notebook VM), and the possible inputs for vscode_build will be stable (by default), or insiders.

Inside the launch_ssh_cloudflared function, you can check for the starting_directory parameter, and generate an IPython Display cell (just like is being done for the Git Repositories when using the init_git_cloudflared function) with the generated link logic for the button being:

if vscode_build == 'stable': 
    link=f"vscode://vscode-remote/ssh-remote+root@{ssh_domain}:{ssh_port}{starting_directory}"
elif vscode_build == 'insiders': 
    link=f"vscode-insiders://vscode-remote/ssh-remote+root@{ssh_domain}:{ssh_port}{starting_directory}"
else: 
    print("Invalid vscode_build argument obtained!")

(Note: The difference in the handler URI for users with the Stable VS Code build and the Insiders VS Code build, might be something you want to consider handling even for the init_git_cloudflared function too)

I hope you would consider writing this functionality into the project, as I believe that some users, including myself, who work on specific directories (mounted Google Drive locations) in Colab will find this feature useful to automatically open into, every time. Greatly appreciate the work you've done with Colab SSH so far. It's by far, such a game changer in the way I use Google Colab for my work.

from colab-ssh.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.