Skip to content

Input::with_initial_text() and Input::interact() do not work together #330

@mbernat

Description

@mbernat

Here is a minimal reproducer.

fn main() {
    let _input: String = dialoguer::Input::new()
        .with_initial_text("initial text".to_string())
        .interact()
        .unwrap();
}

The initial text is printed but cannot be accepted. Other text can still be entered and accepted but the initial text is completely ignored.

Screen.Recording.2025-08-12.at.15.59.48.mov
  • It's notable that Input::interact_text() does not have this problem and behaves as expected.
  • The problem with Input::interact() started happening when the console dependency was updated to 0.15.8.
  • Specifically, the bug seems to be introduced by this console PR: Fix behavior of read_line_initial_text console#190

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