Conversation
|
Could you take a look at the changes I've made to bestline called "llama mode"? llamafile uses bestline which now supports triple quote syntax shown in this screenshot: https://www.phoronix.com/news/Llamafile-0.8.14 Does something like this help your use case? |
Thanks for your hint to "llama mode". I had a look into this. As far as I understand, this does not help here because the triple quote syntax is only for (multiline) commands typed by the user. This pull request is about allowing newlines in the prompt. Bestline quits on a newline in the prompt even with llama mode activated. |
83f6f91 to
a649f93
Compare
jart
left a comment
There was a problem hiding this comment.
I understand now. So you want to be able to say for example:
while((line = bestline("hello\nthere> ")) != NULL) { ... }It's not great that when I press CTRL-L it discards all but the last line. However looking at the code, that would be quite ugly to remedy. So the approach you chose seems pretty reasonable. If you're happy with this, then I approve it.
Thanks!
How to test
You can test multi-line prompts in rc linked with bestline.
This branch alone isn't compatible with rc. But you can use my custom branch which contains some additional changes (like #33):