Skip to content

Pastefix v1.0.0

Choose a tag to compare

@Ch1nYu Ch1nYu released this 09 Aug 17:59
· 22 commits to main since this release

Makes a multi-line command copied from a chat window pasteable into a terminal
in one go.
A small Windows tray app that does two things and nothing else.

What it does

1. Removes the indent common to every line. Relative indentation is kept, so
Python, YAML and here-strings survive.

    if (x) {                 if (x) {
        y = 1        →           y = 1
    }                        }

2. Joins continuation lines. A trailing \, backtick, && or | is
consumed and the lines are glued into one command.

docker run \
    -e FOO=bar \      →    docker run -e FOO=bar image
    image

It also repairs a selection that missed the left margin — where line 1 came out
flush and every line below it carries two extra spaces — but only when line 1 is
a finished statement, so that the indent below has no grammar left to justify it.

Install

Download PasteFix.exe and run it. It sits in the notification area; there is no
installer and nothing is written outside %APPDATA%\PasteFix.

  • Windows 10/11, x64. Self-contained: the .NET runtime is inside the exe, so
    nothing needs installing first. That is why the download is ~49 MB.
  • The exe is not code-signed, so Windows SmartScreen will warn on first run —
    More info → Run anyway. Signing needs a paid certificate this project does
    not have. Verify the checksum below if that matters to you, and note that the
    exe's ProductVersion records the exact commit it was built from.

Using it

Surface What it runs Default
全自動監聽 (auto monitor) Dedent, on every clipboard change on
Alt+V Dedent + margin repair + join, then pastes on
立即清洗 (tray item, or double-click the icon) the same, without pasting —

Auto monitor only ever dedents, which cannot change the structure of anything, so
an ordinary Ctrl+V already benefits. Everything that rewrites text waits for
Alt+V. Copying a multi-line block out of a chat window? Use Alt+V.

Both toggles are in the tray menu and persist to
%APPDATA%\PasteFix\settings.json.

What it deliberately does not do

No line-ending rewriting, no prompt stripping ($ , PS C:\>), no comment
deletion, no markdown fence removal, and no guessing whether a block "looks like
a command". Each of those existed once and was removed for a recorded reason —
see docs/records/PLAN-2026-08-09.md.

Known limitations

  • The margin repair is not sound. A YAML multi-line plain scalar (- a /
    b) has meaningful indentation with nothing opening it above, so it gets
    rewritten. This is a deliberate trade, and a test asserts the damage rather
    than hiding it.
  • Copying from the Claude Code terminal UI leaves two spaces on every line
    but the first. Alt+V handles it; plain Ctrl+V cannot, because what every line
    shares is then nothing.
  • Verified on WezTerm and Windows Terminal with PowerShell 7.6 on Windows 11.
    conhost and non-PowerShell shells are untested — not unsupported, just
    unmeasured.

Not solved

Pasting into PowerShell can still execute lines in the wrong order. That
corruption happens after the clipboard is read, so this program cannot reach
it. tools/paste-probe.ps1 is kept as the instrument for measuring it.

Documentation

PasteFix/README.md is the documentation of record. The dated files in
docs/records/ are the account of how the design got here, including the bug
report that caused five rules to be deleted and one acceptance criterion that was
not met.

Checksum

SHA256  1ed5600230877cc966046c5bbdf57c3b5afb9296d887679920ffd24053b83f8d