Skip to content

Preserve original multiline text in PSReadLine reverse-history insertion - #384

Draft
kelleyma49 with Copilot wants to merge 2 commits into
masterfrom
copilot/reverse-history-backtick-fix
Draft

kelleyma49 with Copilot wants to merge 2 commits into
masterfrom
copilot/reverse-history-backtick-fix

Conversation

Copilot AI commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Reverse-history selection via Ctrl+r was rewriting multiline entries by appending continuation backticks to each non-final line, altering command semantics. This updates insertion to preserve the original history text exactly for multiline commands.

  • Root-cause fix: multiline join delimiter

    • Updated Invoke-FzfPsReadlineHandlerHistory to join picked history lines with a plain newline instead of backtick-newline.
    • Effect: multiline entries are inserted as complete statements unless backticks were already present in the history line content.
  • Behavior coverage for multiline history

    • Added focused tests for:
      • multiline complete statements (no synthetic backticks inserted)
      • multiline entries that already contain explicit continuation backticks (preserved as-is)
# before
$result = $result -join "```n"

# after
$result = $result -join "`n"

Copilot AI changed the title [WIP] Fix unwanted backticks during reverse history insert Preserve original multiline text in PSReadLine reverse-history insertion Jun 20, 2026
Copilot AI requested a review from kelleyma49 June 20, 2026 23:19
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.

2 participants