Skip to content

Commit 90cf640

Browse files
authored
Copilot CLI: Update the Esc behavior (#61904)
1 parent 6c61009 commit 90cf640

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

content/copilot/concepts/agents/copilot-cli/about-copilot-cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ You can interact with {% data variables.product.prodname_copilot_short %} while
184184
{% data variables.copilot.copilot_cli %} automatically manages your conversation context:
185185

186186
* **Auto-compaction**: When your conversation approaches 95% of the token limit, {% data variables.product.prodname_copilot_short %} automatically compresses your history in the background without interrupting your workflow. This enables virtually infinite sessions.
187-
* **Manual control**: Use `/compact` to manually compress context anytime. Press <kbd>Escape</kbd> to cancel if you change your mind.
187+
* **Manual control**: Use `/compact` to manually compress context anytime. Press <kbd>Esc</kbd> to cancel if you change your mind.
188188
* **Visualize usage**: The `/context` command shows a detailed token usage breakdown so you can understand how your context window is being used.
189189

190190
## Customizing {% data variables.copilot.copilot_cli %}

content/copilot/concepts/agents/copilot-cli/cancel-and-roll-back.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ category:
1616

1717
When you work in an interactive {% data variables.copilot.copilot_cli_short %} session, you can press <kbd>Esc</kbd> or <kbd>Ctrl</kbd>+<kbd>C</kbd> to control what {% data variables.product.prodname_copilot_short %} is doing. Both keypresses can cancel operations, but they work slightly differently:
1818

19-
* <kbd>Ctrl</kbd>+<kbd>C</kbd> immediately stops the current operation.
20-
* A single <kbd>Esc</kbd> keypress gives you more gradual control—letting you dismiss dialogs, clear queued prompts, or cancel an operation in stages.
19+
* <kbd>Ctrl</kbd>+<kbd>C</kbd> acts immediately, without a confirming second press—removing any queued prompts first (one per press), then canceling the current operation.
20+
* A single <kbd>Esc</kbd> keypress gives you more gradual, staged control. While {% data variables.product.prodname_copilot_short %} is actively working, a single <kbd>Esc</kbd> doesn't cancel right away—it shows a reminder, and a second press carries out the next step: removing the most recently queued prompt, or canceling the operation once nothing is queued.
2121

2222
If {% data variables.product.prodname_copilot_short %} has already made changes and you want to undo them, you can roll back your workspace to a previous point in the session. {% data variables.copilot.copilot_cli_short %} takes a snapshot of your workspace state each time you enter a prompt, and this allows you to rewind to an earlier state by pressing <kbd>Esc</kbd> twice when {% data variables.product.prodname_copilot_short %} is idle and the input area is empty.
2323

@@ -27,18 +27,19 @@ Pressing <kbd>Esc</kbd> once performs different actions depending on the current
2727

2828
| Current state | What pressing <kbd>Esc</kbd> does |
2929
| ------------- | ------------------------ |
30-
| {% data variables.product.prodname_copilot_short %} is active with no queued prompts. | Cancels the running operation. |
31-
| {% data variables.product.prodname_copilot_short %} is active and there are queued prompts. | Clears the queued prompts without stopping the current operation. |
30+
| {% data variables.product.prodname_copilot_short %} is active with no queued prompts. | Shows an "Esc again to cancel" reminder. The running operation is canceled only if you press <kbd>Esc</kbd> again within half a second. |
31+
| {% data variables.product.prodname_copilot_short %} is active and there are queued prompts. | Shows the "Esc again to cancel" reminder. Pressing <kbd>Esc</kbd> again removes the most recently queued prompt. |
32+
| A permission dialog is open. | A single <kbd>Esc</kbd> denies the pending request (no second press needed). |
3233
| A dialog, overlay, or picker is open. | Closes the dialog, overlay, or picker. |
3334
| {% data variables.product.prodname_copilot_short %} is idle. | Shows a brief reminder that pressing <kbd>Esc</kbd> again quickly will open the rewind picker. See [Rolling back changes](#rolling-back-changes). |
3435

3536
## When to use Esc instead of Ctrl+C
3637

3738
The main difference between these two ways of canceling an operation is that <kbd>Esc</kbd> is designed for gradual, targeted intervention, while <kbd>Ctrl</kbd>+<kbd>C</kbd> is a hard stop.
3839

39-
Use <kbd>Esc</kbd> when you want to interact with {% data variables.product.prodname_copilot_short %} without necessarily ending the current operation. For example, if a permission dialog appears and you want to deny that specific request, pressing <kbd>Esc</kbd> dismisses the dialog and {% data variables.product.prodname_copilot_short %} continues working—it just won't use the tool you denied. Similarly, if you've queued follow-up prompts and want to cancel them without interrupting the work already in progress, <kbd>Esc</kbd> clears the queue while the current operation keeps running. Pressing <kbd>Esc</kbd> only cancels the operation outright if there are no dialogs open and no queued prompts to clear first.
40+
Use <kbd>Esc</kbd> when you want to interact with {% data variables.product.prodname_copilot_short %} without necessarily ending the current operation. For example, if a permission dialog appears and you want to deny that specific request, pressing <kbd>Esc</kbd> dismisses the dialog and {% data variables.product.prodname_copilot_short %} continues working—it just won't use the tool you denied. Similarly, if you've queued follow-up prompts and want to cancel them without interrupting the work already in progress, pressing <kbd>Esc</kbd> removes the most recently queued prompt (repeat to remove earlier ones), while the current operation keeps running.
4041

41-
Use <kbd>Ctrl</kbd>+<kbd>C</kbd> when you want to stop everything at once. It immediately cancels the active operation and clears any queued prompts in a single keypress. Any file write that is already in progress will complete—files are not left corrupted mid-write—but any remaining planned changes are abandoned. Pressing <kbd>Ctrl</kbd>+<kbd>C</kbd> a second time within two seconds, when the input area is empty, exits the session entirely.
42+
Use <kbd>Ctrl</kbd>+<kbd>C</kbd> when you want to cancel without the confirming second press that <kbd>Esc</kbd> requires. If no prompts are queued, a single <kbd>Ctrl</kbd>+<kbd>C</kbd> immediately cancels the active operation. If you have queued prompts, each <kbd>Ctrl</kbd>+<kbd>C</kbd> removes the most recently queued prompt—one per press—and cancels the active operation only once the queue is empty. Any file write that is already in progress will complete—files are not left corrupted mid-write—but any remaining planned changes are abandoned. Pressing <kbd>Ctrl</kbd>+<kbd>C</kbd> a second time within two seconds, when the input area is empty, exits the session entirely.
4243

4344
As a rule of thumb, use <kbd>Esc</kbd> when you want to intervene selectively, and <kbd>Ctrl</kbd>+<kbd>C</kbd> when you want to stop and start over.
4445

0 commit comments

Comments
 (0)