opencode icon indicating copy to clipboard operation
opencode copied to clipboard

fix: record shell mode in history (resolves #5454)

Open ariane-emory opened this issue 1 month ago • 0 comments

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).

ariane-emory avatar Dec 15 '25 07:12 ariane-emory