Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow NULL prompt #207

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Allow NULL prompt #207

wants to merge 2 commits into from

Conversation

culler
Copy link

@culler culler commented Oct 21, 2022

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