Skip to content

[#2516] Hide user prompt if stdin is not connected to a terminal - #2517

Merged
remkop merged 1 commit into
remkop:mainfrom
dchenz:fix/hide-prompt-without-tty
May 10, 2026
Merged

[#2516] Hide user prompt if stdin is not connected to a terminal#2517
remkop merged 1 commit into
remkop:mainfrom
dchenz:fix/hide-prompt-without-tty

Conversation

@dchenz

@dchenz dchenz commented May 10, 2026

Copy link
Copy Markdown
Contributor
  • Moved prompt into parent method and check if there's a tty.
  • Removed the builtin prompt provided by Console.readPassword.
  • Fixed existing interactive tests that rely on tty=true.
  • Added test cases for tty=false asserting stdout is empty.

Manual testing using the cryptomator CLI use case mentioned in the issue.

$ cryptomator-cli create /tmp/testVault --password:stdin
Enter value for --password:stdin (Passphrase, read from STDIN): <type password>
Confirm passphrase: <type password>

[main] INFO  o.c.cli.Create - Vault created successfully in /tmp/testVault

$ echo test123 | cryptomator-cli create /tmp/testVault --password:stdin
[main] INFO  o.c.cli.Create - Vault created successfully in /tmp/testVault

Fixes #2516

- Moved prompt into parent method and check if there's a tty.
- Removed the builtin prompt provided by Console.readPassword.
- Fixed existing interactive tests that rely on tty=true.
- Added test cases for tty=false asserting stdout is empty.

Fixes #2516
@remkop remkop added this to the 4.7.8 milestone May 10, 2026
@remkop remkop added type: enhancement ✨ theme: parser An issue or change related to the parser labels May 10, 2026
@remkop
remkop merged commit a899963 into remkop:main May 10, 2026
36 of 37 checks passed
@dchenz
dchenz deleted the fix/hide-prompt-without-tty branch May 15, 2026 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

theme: parser An issue or change related to the parser type: enhancement ✨

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hide user prompt if stdin is not connected to a terminal

2 participants