Skip to content

Undefined behaviour when prompt has newline #56

@str1ngs-bytes

Description

@str1ngs-bytes

`
// This Code Work's Fine
var App = grumble.New(&grumble.Config{
Name: "Cli",
Prompt: "Main Menu : ",
})

terminal output :
Main Menu :

// This Code Does Not Work
var App = grumble.New(&grumble.Config{
Name: "Cli",
Prompt: "User james Kelly \n >> : ",
})

terminal output :
User james Kelly

//But when pressed 'enter' or typing this happens :
// When Pressed Enter :
User james Kelly
User james Kelly
User james Kelly
">>"
User james Kelly
">>"

// While Typing :
User james Kelly
User james Kelly
User james Kelly
User james Kelly
User james Kelly
">> abcd"

// Expected Same As Single Line Prompt
// When Pressed Enter :
User james Kelly
">>"
User james Kelly
">>"

// While Typing :
User james Kelly
">> abcd"

Note : While typing it prints promt every single key press.
Is there a quick fix to this? I need to deliver to the client asap.
`

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