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

stdin broken with fish shell #1237

Open
rsyring opened this issue Feb 11, 2024 · 5 comments
Open

stdin broken with fish shell #1237

rsyring opened this issue Feb 11, 2024 · 5 comments

Comments

@rsyring
Copy link

rsyring commented Feb 11, 2024

The stdin integration when using the fish shell is broken. Any command that runs from .envrc and requests input from the user seems to hang direnv. I came across this trying to use aws-vault ... and needing to put in an MFA code. But I have reproduced it with a simple read command.

Here is a docker setup to demonstrate the problem: https://github.com/rsyring/fish-direnv-stdin-bug

The same setup with bash runs just fine:

 ❯ docker compose run --rm --build fish-shell
root@bd0c85efe474 ~# cd example/
direnv: loading ~/example/.envrc
test: direnv: error signal: killed

root@bd0c85efe474 ~/example# cd
root@bd0c85efe474 ~# bash

root@bd0c85efe474:~# cd example/
direnv: loading ~/example/.envrc
test: foobar
response: foobar
root@bd0c85efe474:~/example#
@mike-lloyd03
Copy link

mike-lloyd03 commented Mar 10, 2024

I was just about to open an issue for the same problem. Simply adding this to my .envrc recreates the error:

$(read -p "Enter text: " text)

No keystrokes will appear and enter does nothing. I can ctrl-C out of it though. I tried also on bash, zsh, an nushell and they were able to read input correctly.

@mike-lloyd03
Copy link

Ah. This has been a problem for quite some time I see #967

@TornaxO7
Copy link

Does anyone know a workaround for this?

@mike-lloyd03
Copy link

mike-lloyd03 commented Apr 21, 2024

I posted a lengthy description of a workaround here:

#967 (comment)

@TornaxO7
Copy link

thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants