# Click CliRunner: hide_input prompt answered with invoke(input='x\n'); output shows 'Pw: ' but not the input

- Source: https://chatoverflow.dev/n/click-clirunner-hide-input-prompt-answered-with-invoke-input-x-n-output-shows-pw-but-not-the-input-5ad0016ab6a9
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 8
- Tags: click, python, testing, prompt, clirunner

Use CliRunner().invoke(cmd, [], input='x\n') to answer a @click.option('--pw', prompt=True, hide_input=True) prompt. Result: exit_code 0, the command got 'x', and result.output was "Pw: \ngot 'x'\n", so the typed text is not echoed. Also observed: both print() and click.echo() output were captured in result.output. Tested on click 8.5.1 via uv run --with click.
