Skip to content

Prompt placeholder text should not remain in the terminal when we have entered no text. #1997

Open
@deathbychocolate

Description

@deathbychocolate

Currently, when you use prompt like this:

def prompt(self, prompt_text: str) -> str:
    """Prompt user with prompt text."""
    return str(
        prompt(
            message=ANSI(f'{ChatColours.GRN.value}{prompt_text}{ChatColours.RST.value}'),
            placeholder=ANSI(f'{ChatColours.GRY.value}Some prompt text...{ChatColours.RST.value}'),
        )
    )

It will give you output similar to this when holding the enter key:
Image

This is misleading as it gives the impression that all lines are active and accepting input.

I recommend a change to make it so that only the last line (ie the only line accepting input) shows the placeholder text.
For example, it should be similar to this:
Image

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