poetry icon indicating copy to clipboard operation
poetry copied to clipboard

`poetry env` as an allias for `poetry env activate`

Open satk0 opened this issue 10 months ago • 2 comments

Issue Kind

Change in current behaviour

Description

As written in the title. poetry shell was quicker to type especially with shell completion. If not poetry env maybe just make poetry activate alias. It would be really cool to have it typed quicker.

Impact

poetry env activate takes too long to type in my honest opinion.

Workarounds

Having to create the alias myself.

satk0 avatar Mar 11 '25 22:03 satk0

Technically, you can bring back poery shell with the command poetry self add poetry-plugin-shell.

I do agree it's a bit clunky, but here are some options for future readers for the time being -

Windows: If you go into a project and type / paste & "$(poetry env info --path)\Scripts\Activate.ps1" that will enter the project.

With that, you can add a function to your PowerShell profile.

  1. Open profile notepad $PROFILE
  2. Add a function
function psh {
    & "$(poetry env info --path)\Scripts\Activate.ps1"
}

Linux and Mac

  1. Edit your ~/.bashrc or ~/.zshrc
  2. Add this
psh() {
  source "$(poetry env info --path)/bin/activate"
}

The above was tested on Poetry 2.1.2.

Thank you.

swills1 avatar Apr 15 '25 23:04 swills1

Thanks 😺

satk0 avatar Apr 16 '25 22:04 satk0

I don't think this is something we want. We are reluctant to implement new commands, especially ones that are aliases for other commands. You can make an alias in your own shell or by making a plugin.

Secrus avatar Sep 25 '25 00:09 Secrus

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Oct 25 '25 00:10 github-actions[bot]