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

Forward stdin when terminal is a TTY #17

Open
desbma opened this issue Dec 14, 2024 · 3 comments
Open

Forward stdin when terminal is a TTY #17

desbma opened this issue Dec 14, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@desbma
Copy link

desbma commented Dec 14, 2024

When using right.backend.auth.cmd to get password from a program that itselfs prompts a password (ie. keepassxc-cli to unlock a database), there is absolutely no UI feedback, so neverest appears to be frozen, when the subprocess is just waiting for a password input.

Setting right.backend.auth.cmd = "echo 'Enter password> ' && keepassxc-cli ..." as a workaround does not work either, because the process stdout is captured by neverest.

@soywod
Copy link
Member

soywod commented Dec 19, 2024

there is absolutely no UI feedback

Indeed, stdin is not forwarded when spawning commands. Commands are responsible for prompting their own input. For example, when running GPG commands, people should use the right flavour of pinentry (GTK, QT…).

That said, Neverest could check if the current terminal is a TTY:

  • If so, then it can forward stdin to send input to commands
  • If not, keep the actual behaviour (do not forward stdin)

@soywod soywod added the bug Something isn't working label Dec 19, 2024
@soywod soywod added this to Pimalaya Dec 19, 2024
@soywod soywod moved this to Todo in Pimalaya Dec 19, 2024
@desbma
Copy link
Author

desbma commented Dec 19, 2024

That said, Neverest could check if the current terminal is a TTY:

* If so, then it can forward stdin to send input to commands

* If not, keep the actual behaviour (do not forward stdin)

Sounds good to me.

Another nice addition would be to output a message like Getting password with command XXX..., that way the user would now Neverest is waiting for a subprocess. This is the root issue in my opinion, when I added --debug, I immediately understood what was going on.

@soywod
Copy link
Member

soywod commented Dec 19, 2024

Another nice addition would be to output a message like Getting password with command XXX..., that way the user would now Neverest is waiting for a subprocess. This is the root issue in my opinion, when I added --debug, I immediately understood what was going on.

I am not convinced about a message, I believe logs are fine. They should be used exactly the way you did: when you have a problem and try to dig. Otherwise I am afraid such messages will disturb the whole experience.

Let's keep this issue open for the stdin forwarding. Thank you for your feedback!

@soywod soywod changed the title [UX] No UI feedback when prompting password Forward stdin when terminal is a TTY Dec 19, 2024
@soywod soywod self-assigned this Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Todo
Development

No branches or pull requests

2 participants