[PR #5551] fix: record shell mode in history (resolves #5454) #11470

Closed
opened 2026-02-16 18:16:18 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/5551

State: closed
Merged: Yes


Fixes bug 1 from issue #5454 where shell commands were not properly recalled from message history. Previously, when typing a shell command such as, e.g., !date, only the date text was stored in history, not the shell mode. When recalling with up arrow, this caused the command to be sent as a text message to the model instead of executed as a shell command. With this PR, the shell mode state is recorded alongside the message so that it is properly restored when cycling through the command history.

Changes:

  • Add optional mode field to PromptInfo type
  • Store current mode when appending to history
  • Restore mode (defaulting to 'normal' for backward compatibility) when recalling from history

Resolves #5454 (at least, the 'bug 1' part of it).

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/5551 **State:** closed **Merged:** Yes --- Fixes bug 1 from issue #5454 where shell commands were not properly recalled from message history. Previously, when typing a shell command such as, e.g., `!date`, only the `date` text was stored in history, not the shell mode. When recalling with up arrow, this caused the command to be sent as a text message to the model instead of executed as a shell command. With this PR, the shell mode state is recorded alongside the message so that it is properly restored when cycling through the command history. Changes: - Add optional `mode` field to PromptInfo type - Store current mode when appending to history - Restore mode (defaulting to 'normal' for backward compatibility) when recalling from history Resolves #5454 (at least, the 'bug 1' part of it).
yindo added the pull-request label 2026-02-16 18:16:18 -05:00
yindo closed this issue 2026-02-16 18:16:18 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#11470