Repository navigation
v2.31.3
Fixes
-
fish and tcsh command lines are quoted with their own rules. Both shells used the POSIX quoting of the generic shell, which broke values that are legal in them:
- fish treats a backslash before a single quote as an escape, so the POSIX
'"'"'trick left the closing quote escaped anda\'bwas a syntax error. fish now doubles backslashes and escapes single quotes inside one single quoted string. - csh performs history substitution even inside single quotes, and a plain newline ends the quoted string:
a!bfailed with "Event not found" and a multi line value was an unmatched quote. Exclamation marks, newlines and single quotes are now escaped individually.
- fish treats a backslash before a single quote as an escape, so the POSIX
-
Round-trip tests cover every shell. The new tests run bash, zsh, fish and tcsh when they are installed and compare the argument the shell passes with the original bytes; the shell integration CI job now runs them for all four shells. This is how the fish and tcsh defects were found.
-
The output tests tolerate a loaded machine: the suite runs packages in parallel and a healthy
echois no longer reported as a timeout.
Verification
- Full test suite,
gofmt,go vet,staticcheckand the rule list check pass. - CI is green on Linux, macOS and Windows with lint and the 94% coverage gate, including the new quote round-trip step against real bash, zsh, fish and tcsh.
- Local round-trip runs with the extracted shell binaries: 40/40 quoted words (10 values x 4 shells) reach the shell unchanged.
- Distribution manifests are regenerated for 2.31.3 and the AUR package is published as 2.31.3-1.
Upgrade
Homebrew, Scoop and AUR update through their package managers; go install github.com/leafevans/go-fuck/v2/cmd/go-fuck@latest picks up 2.31.3.
Changelog
- cdf68e6: fix(shells): quote fish and tcsh command lines with their own rules (@leafevans)
- 1821c36: test: tolerate a loaded machine in the output tests (@leafevans)
Full Changelog: v2.31.2...v2.31.3