-
Notifications
You must be signed in to change notification settings - Fork 4
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
Avoid using pexpect in poetry shell #18
Comments
FWIW this is very much possible, but it runs into the problems of Pipenv's 'fancy shell.' On the Pipenv side of things, they meant to make fancy the default, but so many users have their shell misconfigured that it's a crapshoot if it works. Specifically, the issue is thus:
In order for this model to work, the user's shell configuration needs to be well-behaved and only prepend in the root shell. Typically, but not always, said root shell is There are also some situations in which I personally would like to see this, as it would reduce a lot of complexity and make many things simpler in Poetry. However, the current imperfect usage of pexpect is because most users cannot be bothered to understand the finer points of shell configuration and blame Poetry if things don't "just work." There is a reason that the (detested by many users, hence the existence of All this being said, I wouldn't mind a breaking change in a major version where we go ahead and make |
(would love some opinions on this from @python-poetry/core as well) |
personally I never use I don't expect this view to carry the day. |
I generally agree with dimbleby, but that would be a big change in CLI API. Overall, the |
We can't just This is also fraught as our changes run before the user's shell configuration and thus are subject to being clobbered by poorly configured shells. There is a third option that will be less obvious to users but is the 'best' in terms of consistency: That is to say, in order to alter the current environment, we print shell script to stdout. I don't expect this to be popular as an alternative either; however I do think that we can no longer treat It seems that that attitude is no longer tenable as too many new users get cut by the sharp edges and compromises of |
poetry shell
has a surprising behavior of spawning a pexpect wrapper which proxies I/O streams between the user and the application. This makespoetry shell
unsuitable as a general purpose shell configuration tool: aside from the performance implications, pexpect does not deal correctly with programs that directly access the tty to interact with the terminal (and was never intended to be a full blown terminal application proxy).It would be much better if
poetry shell
could simply spawn the shell viaos.exec()
after configuring the environment, to avoid having to proxy anything. This would be more consistent with user expectations and would prevent applications from breaking when running insidepoetry shell
.The text was updated successfully, but these errors were encountered: