Skip to content
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

nushell: issues regarding poetry shell #8370

Closed
4 tasks done
icp1994 opened this issue Aug 27, 2023 · 5 comments
Closed
4 tasks done

nushell: issues regarding poetry shell #8370

icp1994 opened this issue Aug 27, 2023 · 5 comments
Labels
kind/bug Something isn't working as expected status/triage This issue needs to be triaged

Comments

@icp1994
Copy link

icp1994 commented Aug 27, 2023

  • Poetry version: 1.6.1
  • Python version: 3.11.4
  • OS version and name: Void Linux (Rolling)
  • pyproject.toml: generated default from poetry new poetry-nu
  • I am on the latest stable Poetry version, installed using a recommended method.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have consulted the FAQ and blog for any relevant entries or release notes.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.

Issue

In nushell, the poetry shell command spawns a new shell but doesn't activate associated venv - instead just prints the activation command.
image
This isn't much of an issue by itself since I only have to press <RET> to run the command and activate the venv. But in the spawned shell, if I start any REPL program their input becomes invisible/masked!
image

@icp1994 icp1994 added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Aug 27, 2023
@dimbleby
Copy link
Contributor

You'll likely need to figure out what's going on for yourself if this is important to you.

(My advice whenever people have problems with poetry shell is always: just don't use it! Instead, simply activate your virtual environment as you would have done if poetry shell had never existed)

Some possible clues

  • looks like fix: fix poetry shell for nushell #7919 was supposed to send the newline, you can start by investigating why that's not working as expected.
  • masked input/output is surely something specific to do with your setup. I suppose that poetry shell and nushell are not a tremendously common combination but - eg per that issue - you're surely not the first to try it and others would have noticed if this was what usually happened...

@icp1994
Copy link
Author

icp1994 commented Aug 28, 2023

After some digging, it's something to do with setecho(False). I don't get invisible inputs when I manually activate the venv or if I edit out "nu" from this conditional.

Related: nushell/nushell#6225

@abn
Copy link
Member

abn commented Feb 29, 2024

I am going to close this for now as this seems like an environment issue rather than a Poetry one. Additionally since #7919 fixes the new line issue and it looks like users are using poetry shell fine under nu, it might not something that affects every nu shell user using Poetry.

@icp1994 if you figure out that this is indeed something to do with Poetry's shell setup and have a fix, please send us a pull request with the details. We can consider it then.

@abn abn closed this as not planned Won't fix, can't repro, duplicate, stale Feb 29, 2024
@icp1994
Copy link
Author

icp1994 commented Feb 29, 2024

It's works as expected in the current version (0.90.1) of nushell so likely fixed somewhere in between. But I have moved on to using your suggestion of manually activating venvs as if the subcommand doesn't exist instead.

Copy link

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 github-actions bot locked as resolved and limited conversation to collaborators Mar 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected status/triage This issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

3 participants