github / github/copilot-cli

Ctrl-D in  ask_user /elicitation form fields triggers session shutdown and discards in-progress input

Open
#4,866 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

triage
Dominant language
Shell
Stars
11.2k
Forks
1.9k
Avg merge
14h 16m
Merged PRs (30d)
6

Description

Describe the bug

Summary: In the main prompt composer, Ctrl-D behaves correctly (deletes the character under the cursor when the line is non-empty; only signals EOF/shutdown on an empty line — the behavior fixed some months ago). However, when the agent presents an  ask_user  elicitation form and I'm typing an answer into a form text field, pressing Ctrl-D immediately triggers "shutdown" and discards everything I'd typed into the form. It appears the non-empty-line guard applied to the main composer's Ctrl-D handler was never applied to the elicitation/form input widget.

Impact: Repeated loss of carefully composed answers (happened ~6 times in one session).

Severity: High — silent data loss of user input; unexpected shutdown.

Suggested fix: Route the form field's Ctrl-D through the same handler/guard as the main composer (non-empty line ⇒ delete-char; empty ⇒ ignore or blur, not global shutdown).

Affected version

Copilot CLI 1.0.83, macOS (darwin-arm64)

Steps to reproduce the behavior

Steps to reproduce:

  1. Have the agent call a tool that shows an  ask_user  form with a free-text field.
  2. Start typing a multi-line/long answer into the field.
  3. Press Ctrl-D (e.g. out of habit, to delete a character).
  4. Observe: the session shuts down / the form is torn down and the typed answer is lost.
Expected behavior

Expected: In a form field, Ctrl-D should either delete the character under the cursor (matching the main composer) or be a no-op — it should NOT invoke global shutdown while a non-empty field has focus.

Actual: Ctrl-D invokes global shutdown regardless of field contents, discarding in-progress input.

Additional context

No response

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 at the ask_user elicitation form's text-field input widget and compare its Ctrl-D handling with the main prompt composer, where the non-empty-line guard is already described as working. Reproduce the behavior with a focused form field, then verify that Ctrl-D no longer triggers global shutdown or discards non-empty input while the expected empty-field behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.