nushell / nushell/reedline

Make Ctrl + C signal give partial buffer

Open
#565 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-API enhancement
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.