Skip to content

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

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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