github / github/copilot-cli

Esc in /tasks overlay also dismisses active question prompt

Offen
#3,430 1 Kommentar 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
area:agents area:input-keyboard
Vorherrschende Sprache
Shell
Sterne
11.2k
Forks
1.9k
Ø Merge
14 Std. 16 Min.
Gemergte PRs (30 T.)
6

Beschreibung

### Describe the bug

When the Copilot CLI `/tasks` overlay is open and the agent asks a question, pressing `Esc` to close the task/subagent menu also affects the underlying question prompt.

The same `Esc` keypress appears to be handled twice:

1. It closes the `/tasks` overlay.
2. It also dismisses or skips the active question prompt underneath.

This prevents the user from answering the question and can cause the agent to continue with an unintended skipped/default response.

This seems inconsistent with the documented `Esc` behavior for Copilot CLI, where an open dialog, overlay, or picker should be closed before `Esc` acts as a broader cancel action.

References:

- [`/tasks` command reference](https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-command-reference)
- [`Esc` behavior in Copilot CLI](https://docs.github.com/en/copilot/concepts/agents/copilot-cli/cancel-and-roll-back)
- [`/fleet` and subagent task execution](https://docs.github.com/en/copilot/concepts/agents/copilot-cli/fleet)

### Affected version

GitHub Copilot CLI 1.0.49.

### Steps to reproduce the behavior

1. Start an interactive Copilot CLI session.
2. Start a task that uses subagents or background tasks.
3. Open the task/subagent manager with `/tasks`.
4. While the `/tasks` overlay is open, wait for the agent to ask a question or clarification.
5. Press `Esc` once, intending only to close the `/tasks` overlay.
6. Observe that the active question is also skipped or dismissed.

### Expected behavior

Pressing `Esc` while the `/tasks` overlay is open should only close that overlay and return focus to the active question prompt.

The question should remain visible and answerable.

### Additional context

This looks like a key handling or focus propagation issue. The `/tasks` overlay appears not to consume the `Esc` event after using it to close itself, so the same keypress reaches the global cancel handler or the underlying question UI.

A possible fix would be to make the `/tasks` overlay treat `Esc` as handled when it closes the overlay, preventing the key event from being forwarded to lower-priority UI layers.

A regression test could cover this stacked UI case:

1. An active question prompt is visible underneath the `/tasks` overlay.
2. The user presses `Esc` once.
3. Only the `/tasks` overlay closes.
4. The question prompt remains open and answerable.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Reproduziere den gestapelten UI-Fall, indem du das /tasks-Overlay öffnest, während eine Fragenaufforderung aktiv ist, und dann einmal Esc drückst. Verfolge die Verarbeitung von Esc vom /tasks-Overlay bis zur darunterliegenden Fragenaufforderung und füge einen Regressionstest hinzu, der diese Sequenz abdeckt. Als erledigt gilt dies, wenn das Overlay geschlossen wird, während die Frage sichtbar und beantwortbar bleibt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
shell
Bereich
cli
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
55/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.