Repository navigation
v2.31.2
Fixes
-
PowerShell command lines are quoted and split with PowerShell rules. The PowerShell shell inherited the POSIX quoting and splitting of the generic shell, which broke single quotes and absolute Windows paths:
- Quoting a corrected command for
--repeator a git alias expansion used the shlex'"'"'escape. PowerShell does not concatenate adjacent string literals, so it parsed that as several arguments and a correction such asgit commit -m 'hello'was broken. PowerShell single quoted strings with doubled quotes now round-trip exactly. - Splitting treated the backslash as an escape character, so a Windows path lost its backslashes. Rules that compare the path of the command line with the path in the error message never matched an absolute path:
cat C:\Windowsreported no suggestion instead ofls C:\Windows.cat,gc,typeandGet-Contenton absolute Windows paths (quoted or not) now get thelssuggestion, and the same fix covers the other rules that parse arguments, including the history based rules.
- Quoting a corrected command for
Verification
- Full test suite,
gofmt,go vet,staticcheckand the rule list check pass; the new tests compare the splitter and the quoting round-trip against a real Windows PowerShell 5.1, and the rule test covers an absolute Windows path. - CI is green on Linux, macOS and Windows with lint and the 94% coverage gate; live checks with an isolated configuration directory confirm the four absolute path scenarios and that relative paths still work.
- Distribution manifests are regenerated for 2.31.2 and the AUR package is published as 2.31.2-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.2.
Changelog
- cf3fef0: fix(powershell): quote and split command lines with PowerShell rules (@leafevans)
Full Changelog: v2.31.1...v2.31.2