Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Semi-automatic activation #204

Open
3 tasks done
Evpok opened this issue Feb 9, 2021 · 6 comments
Open
3 tasks done

Semi-automatic activation #204

Evpok opened this issue Feb 9, 2021 · 6 comments

Comments

@Evpok
Copy link

Evpok commented Feb 9, 2021

  • I have searched the issues (including closed ones) and believe that this is not a duplicate.
  • I have searched the documentation and believe that my question is not covered.
  • I am willing to lend a hand to help implement this feature.

Feature Request

I really like the idea of linking directories to envs, but at the same time I don't always want to activate the linked env when I cd into a dir. It would be nice if there was way to manually activate the environment linked to by vf connect even with auto_activation disabled. This could take the form of a dedicated command, or just the behaviour of vf activate without specifying an env (look into VIRTUALFISH_ACTIVATION_FILE and activate the env you find there`.

@justinmayer
Copy link
Owner

Hi @Evpok. Environments shouldn't be automatically activated via cd if automatic activation is disabled. I don't have time to parse and understand what you mean, so it's important when filing issues to be really specific and unequivocally clear. With that in mind, can you elaborate?

@Evpok
Copy link
Author

Evpok commented Feb 9, 2021

Hi @justinmayer, let me try to reformulate: I wish to have links between directories and environments without using automatic activation, which is currently not supported. The behaviour I am looking for is for vf activate to look for a .venv (or whatever vf connect creates) file in the current directory, and if there is one, to activate the corresponding environment.

@justinmayer
Copy link
Owner

So, to summarize, you want to save a few keystrokes by typing vf activate instead of vf activate (cat .venv). Do I have that right?

@Evpok
Copy link
Author

Evpok commented Feb 9, 2021

More like vf activate (cat $VIRTUALFISH_ACTIVATION_FILE) but yes, that's the idea.

@justinmayer
Copy link
Owner

My suggestion would be to define an abbreviation, replacing vfa with your desired short-cut/macro:

abbr -a vfa vf activate (cat $VIRTUALFISH_ACTIVATION_FILE)

That way you get what you want in three keystrokes.

But if you want to submit a pull request that activates the relevant virtual environment when vf activate is invoked with no arguments and a $VIRTUALFISH_ACTIVATION_FILE is present in the current working directory, I can't think of any obvious impediments to merging it.

Thoughts?

@Evpok
Copy link
Author

Evpok commented Feb 10, 2021

Right, I'll do both: start with the abbreviation and see if I can get a PR to work. Thanks!

Evpok added a commit to Evpok/virtualfish that referenced this issue May 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants