Skip to content

Allow NULL prompt - #207

Open
culler wants to merge 2 commits into
antirez:masterfrom
culler:master
Open

Allow NULL prompt#207
culler wants to merge 2 commits into
antirez:masterfrom
culler:master

Conversation

@culler

@culler culler commented Oct 21, 2022

Copy link
Copy Markdown

When a NULL prompt is passed the linenoise() function it will assume that a prompt has already been written. It computes the length of the prompt from cursor position at the time it is called and avoids writing over the prompt when editing. This allows using linenoise to add line editing capability to a program (e.g. tclsh) which provides a REPL, so prints its own prompts, but does not provide any command line editing.

When a NULL prompt is passed the linenoise() function will assume that a prompt has already been written.  It computes the length of the prompt from cursor position at the time it is called and avoids writing over the prompt when editing.  This allows using linenoise to add line editing capability to a program (e.g. tclsh) which provides a REPL, so prints its own prompts, but does not provide any command line editing.
Allow passing a NULL prompt to linenoise()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant