On Windows why does "poetry shell" remove/lose shell history features?
This is definitely one of the pain points in using Poetry. I don't know what causes this. My workaround: activate the virtual environment Poetry creates manually instead. This avoids whatever Poetry does to interfere with cmd.exe's history. To do this, I ask Poetry where it created its venv, then copy and paste that plus Scripts\activate
to enter a working venv. For example:
C:\>poetry env info
Virtualenv
Python: 3.9.8
Implementation: CPython
Path: C:\Users\xxx\AppData\Local\pypoetry\Cache\virtualenvs\
runestone-poetry-project-kVed82-L-py3.9
Valid: True
System
Platform: win32
OS: nt
Python: C:\Users\xxx\AppData\Local\Programs\Python\Python39
C:\>C:\Users\xxx\AppData\Local\pypoetry\Cache\virtualenvs\
runestone-poetry-project-kVed82-L-py3.9\Scripts\activate
(runestone-poetry-project-kVed82-L-py3.9) C:\>
Another workaround: use poetry run pwsh
to run PowerShell instead; its history works properly (but, of course, PowerShell is very different than cmd).