Skip to content

fix(zsh): join multiline extended history entries#487

Open
leno23 wants to merge 1 commit into
cantino:masterfrom
leno23:fix-zsh-multiline-history-87
Open

fix(zsh): join multiline extended history entries#487
leno23 wants to merge 1 commit into
cantino:masterfrom
leno23:fix-zsh-multiline-history-87

Conversation

@leno23
Copy link
Copy Markdown

@leno23 leno23 commented May 25, 2026

Summary

Fixes #87.

When zsh extended history is enabled, multiline commands are stored as a timestamped first line followed by continuation lines without timestamps. McFly previously treated each physical line as a separate command, so multiline entries were split and often only the last line was searchable.

This change joins continuation lines into a single command when extended_history is enabled. Separate commands that happen to end with \ remain distinct because each has its own timestamp line.

Test plan

  • Added unit tests for multiline join, separate commands, and non-extended line-by-line behavior
  • cargo test shell_history

When zsh extended history is enabled, continuation lines without a
timestamp prefix belong to the previous command. Parse and join them
instead of treating each physical line as a separate command.

Fixes cantino#87

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

zsh: mcfly incorrectly parses multi-line zhistory entries

1 participant