Skip to content

Input is invisible when prompt line's length is larger then window width #247

@Jan0660

Description

@Jan0660

Input is invisible when a line in the prompt is longer than the console width. The issue also occurs when the prompt is filled with ANSI sequences instead of visible text. This does not seem to be a terminal(tested VSCode's, Jetbrains' and Windows Terminal) issue.

Reproduction:

using System.Text;
using PrettyPrompt; // using 4.0.4 off of NuGet

var config = new PromptConfiguration();
var prompt = new Prompt(configuration: config);

while (true)
{
    var str = new StringBuilder("prompt: ");
    for(int i = 0; i < 100; i++)
        str.Append("hellohello");
        // str.Append("\u001b[0m");
    config.Prompt = str.ToString();
    var input = await prompt.ReadLineAsync();
    Console.WriteLine("input: " + input.Text);
}

With appending "hellohello" from the above code:
image
And with appending the ANSI reset:
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions