Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
deathbychocolate opened this issue Jun 7, 2025 · 0 comments

Comments

@deathbychocolate
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant