Skip to content

Password input prevents interrupt even when configured #352

Description

@detly

Even if interrupts are allowed to propagate eg. by using ctrlc, the password prompt seems to inhibit this (at least, via CTRL-C). Here's a test program:

fn main() -> std::io::Result<()> {
    _ = ctrlc::set_handler(|| {});

    dialoguer::Input::<String>::new()
        .with_prompt("You can interrupt this")
        .report(false)
        .interact()?;

    dialoguer::Password::new()
        .with_prompt("You cannot interrupt this")
        .report(false)
        .interact()?;

    Ok(())
}

I suspect the issue is actually in the console crate (in read_secure()) but I haven't had an opportunity to narrow the test down to just that.

  • Dialoguer 0.12.0
  • Rust 1.94.0
  • Ubuntu 24.04.4
  • Zsh 5.9

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions