Make Ctrl + C signal give partial buffer
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 818
- Forks
- 249
- Avg merge
- 4d 14h
- Merged PRs (30d)
- 30
Description
I'm making a REPL and using reedline for it. So far, everything is working perfectly except for one thing: I would like to be able to make the REPL exit if you hit ctrl + C with an empty buffer. I tried getting the current buffer on receiving the CtrlC signal, but it seems the buffer is cleared before the signal is sent. Is there any chance the signal could be sent first, and the buffer retained until read line is called again?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how reedline handles the Ctrl+C signal, clears the current buffer, and returns from read line. Check the existing signal-handling tests or entry points, if present, before deciding where the buffer state is lost. Done means a Ctrl+C on non-empty input exposes the partial buffer, while Ctrl+C on an empty buffer can still terminate the REPL.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100