Describe the feature or problem you'd like to solve
When using the ! prefix to run shell commands, there's no way to recall previously typed shell commands. In a normal terminal, pressing Up/Down cycles through command history — but within the Copilot CLI prompt, Up/Down navigates the Copilot conversation history instead.
This means if you ran !git status, !npm test, etc. earlier in a session, you have to retype them from scratch each time.
Proposed solution
Maintain a separate command history for !-prefixed shell commands. Once the user types !, Up/Down arrow keys should cycle through previous ! commands rather than Copilot prompt history.
Possible behaviors:
- After typing
!: Up/Down recalls previous shell commands (most recent first)
- On empty prompt: Up/Down continues to recall Copilot prompt history (current behavior)
- History could optionally persist across sessions (like
.bash_history)
Example prompts or workflows
- Type
!git status → runs successfully
- Type
!npm run build → runs successfully
- Type
! then press Up → populates with !npm run build
- Press Up again → populates with
!git status
- Press Enter → re-runs selected command
Additional context[/+]
[+]Related: #1166 (tab completion for PATH commands after !) — in this issue, i point out that it might just be best to fork a shell immediately on ! and feed it keystrokes from the user. so the command completion history would be the shell's and any other TAB completion features are handled by the shell.
Describe the feature or problem you'd like to solve
When using the
!prefix to run shell commands, there's no way to recall previously typed shell commands. In a normal terminal, pressing Up/Down cycles through command history — but within the Copilot CLI prompt, Up/Down navigates the Copilot conversation history instead.This means if you ran
!git status,!npm test, etc. earlier in a session, you have to retype them from scratch each time.Proposed solution
Maintain a separate command history for
!-prefixed shell commands. Once the user types!, Up/Down arrow keys should cycle through previous!commands rather than Copilot prompt history.Possible behaviors:
!: Up/Down recalls previous shell commands (most recent first).bash_history)Example prompts or workflows
!git status→ runs successfully!npm run build→ runs successfully!then press Up → populates with!npm run build!git statusAdditional context[/+]
[+]Related: #1166 (tab completion for PATH commands after
!) — in this issue, i point out that it might just be best to fork a shell immediately on!and feed it keystrokes from the user. so the command completion history would be the shell's and any other TAB completion features are handled by the shell.