virtualenv icon indicating copy to clipboard operation
virtualenv copied to clipboard

Virtualenv should support workon command by default.

Open Almas-Ali opened this issue 1 year ago • 4 comments

What's the problem this feature will solve?

We can activate a virtualenv by just typing workon env_name. This feature exists in some other virtual environment packages in Pypi. But I think this feature should in this package as well.

Describe the solution you'd like

This will help to active an environment easy with just a command and will be same for Windows and Linux or Mac as well. No more multiple commands for different operating system.

We can add a entry_points script name workon and add activation commands built in to that.

Almas-Ali avatar Feb 12 '24 08:02 Almas-Ali

How would this workon behave? How does it know what to activate?

gaborbernat avatar Feb 12 '24 19:02 gaborbernat

For example you have an environment .venv you can use workon .venv to activate it. Behind the sean it detects the OS and set the path automatically. I can give it a pull request, if the maintainers agrees to do so.

Almas-Ali avatar Feb 13 '24 05:02 Almas-Ali

PR welcome. Just make sure to implement it for all shells we support, with tests. IMHO one of the big challenges will be how to detect and adapt it to each shell.

gaborbernat avatar Feb 13 '24 05:02 gaborbernat