Skip to content

InputValue prompt with mask doesn't return the enter value, only the repeated mask character #1103

@fkirchhoff

Description

@fkirchhoff

This example illustrates the problem:

        Terminal terminal = TerminalBuilder.builder().system(true).build();
        ConsolePrompt consolePrompt = new ConsolePrompt(terminal);
        PromptBuilder builder = consolePrompt.getPromptBuilder().createInputPrompt()
                .name("secret").message("secret>").mask('*').addPrompt();
        Map<String, PromptResultItemIF> answer = consolePrompt.prompt(builder.build());
        System.out.println("secret:"+answer.get("secret").getResult());

will result in:

? secret> ****
secret:****

even though I entered 1234.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions