zsh-activate-py-environment icon indicating copy to clipboard operation
zsh-activate-py-environment copied to clipboard

Impossible to handle `SDTOUT` from `zsh-activate-py-environment.plugin.zsh`

Open tapyu opened this issue 1 year ago • 6 comments

Currently, I am needing to get rid of all STDOUT since you are using it

https://github.com/se-jaeger/zsh-activate-py-environment/blob/60f7d30b927d0d6e37ed8eeba9b788c319e1136e/zsh-activate-py-environment.py#L295

to evaluate this STDOUT in

https://github.com/se-jaeger/zsh-activate-py-environment/blob/60f7d30b927d0d6e37ed8eeba9b788c319e1136e/zsh-activate-py-environment.plugin.zsh#L7

Since you have created a code that depends on this channel to make it work, I am currently getting rid of this SDTOUT with stdout=DEVNULL. .

https://github.com/se-jaeger/zsh-activate-py-environment/blob/60f7d30b927d0d6e37ed8eeba9b788c319e1136e/zsh-activate-py-environment.py#L289

The problem is: This STDOUT that is import too! Without it, when poetry install takes too long, the terminal just become idle for an eternity: image

Without printing any information about the installing.

For me, it is clear that the way you've created this plugin is not right. A Unix shell script should create and activate Python environments, not a Python script, let alone resorting the STDOUT of a Python script to activate an environment... STDOUT doesn't serve to trigger a command on the parent process. Rather, it serves to the program communicates to the end user. Try removing stdout=DEVNULL from this command to see how it breaks your code.

Let me know if you agree on this issue. If so and if PRs are welcome, I can take some time to fix it.

tapyu avatar Jan 26 '24 13:01 tapyu