Skip to content

PowerShell prompt string not modified by poetry shell #4560

@AndreaCogliati

Description

@AndreaCogliati
  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

Issue

poetry shell doesn't update the PowerShell prompt string, so there's no visual cue that a poetry environment is active in the current shell. See sample output:

Poetry (1.1.10) is installed now. Great!
PS C:\Users\Andrea Cogliati\source\repos\pigs> poetry new poetry-demo
Created package poetry_demo in poetry-demo
PS C:\Users\Andrea Cogliati\source\repos\pigs> cd .\poetry-demo\
PS C:\Users\Andrea Cogliati\source\repos\pigs\poetry-demo> poetry shell
Creating virtualenv poetry-demo-g8BhE-uU-py3.7 in C:\Users\Andrea Cogliati\AppData\Local\pypoetry\Cache\virtualenvs
Spawning shell within C:\Users\Andrea Cogliati\AppData\Local\pypoetry\Cache\virtualenvs\poetry-demo-g8BhE-uU-py3.7
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS C:\Users\Andrea Cogliati\source\repos\pigs\poetry-demo> ls


    Directory: C:\Users\Andrea Cogliati\source\repos\pigs\poetry-demo


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
d-----         9/25/2021   4:31 PM                poetry_demo
d-----         9/25/2021   4:31 PM                tests
-a----         9/25/2021   4:31 PM            324 pyproject.toml
-a----         9/25/2021   4:31 PM              0 README.rst

PS C:\Users\Andrea Cogliati\source\repos\pigs\poetry-demo> $host.version

Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      19041  1237

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions