chzyer / readline

Readline is a pure go(golang) implementation for GNU-Readline kind library
MIT License
2.08k stars 275 forks source link

Prompt doesn't update mid-command #108

Open jD91mZM2 opened 7 years ago

jD91mZM2 commented 7 years ago

Hey!
I'll start with giving you a context:

Imagine a program which takes newlines, with the prompt "foobar".
foobar> this is a te
but... just as I start typing, there is some event trigger. Now I get

foobar> this is a te
notification!

.

BUT! Once I start typing, readline is super clever, and fill in the previous input!

foobar> this is a te
notification!
foobar> this is a tes

.
That's all good.
... but if I change the prompt, it does not update however.
it stays foobar until the next input.

foobar> this is a te
notification!
changed prompt to "foo"
foobar> this is a tes

I'd love a way to update this mid-command! =)