Skip to content

Audit follow-ups: backup-suffix parsing, terminal-cleanup gating, docs#12

Open
chiro-hiro wants to merge 3 commits into
masterfrom
audit-fixes-2026-05-followup
Open

Audit follow-ups: backup-suffix parsing, terminal-cleanup gating, docs#12
chiro-hiro wants to merge 3 commits into
masterfrom
audit-fixes-2026-05-followup

Conversation

@chiro-hiro

Copy link
Copy Markdown
Owner

Follow-up audit fixes on top of the merged #1. Three small, independent changes.

Changes

  1. Installer backup-suffix parsing (install.sh, get-ivim.sh) — find_latest_backup() now parses the <epoch>.<counter> suffix introduced for same-second collision avoidance. Before this, a same-second collision produced a .bak.<epoch>.<counter> name that failed the bare-integer check, so uninstall could restore the wrong backup (or none). Both components are now validated as integers and ties break on the counter.

  2. Terminal cleanup gating (plugin/keymaps.vim + matching CLAUDE.md note) — move cleanup off VimLeavePre (which fires too late to pre-empt the E947 "job still running" check on :qall) back to QuitPre, but gated on the last ordinary (non-terminal) window. Result: no spurious terminal kills on a single-window or aborted :q, and no E947 on a real :qall exit.

  3. Docs (CLAUDE.md) — correct the autocomplete trigger-char list to the real single-char union (. > : < / $ and space) and drop the phantom ::/-> examples. Addresses the CLAUDE.md item in Documentation drift: start-screen “any key”, CLAUDE.md triggers, README trigger list & structure tree #11.

Verification

  • bash -n clean on both installers
  • keymaps.vim sources without error; autocmd is now QuitPre → s:CloseTerminalsOnExit

Not addressed here (kept open)

🤖 Generated with Claude Code

chiro-hiro and others added 3 commits May 29, 2026 15:45
Same-second re-installs append a .<counter> to the .bak.<epoch> name to
avoid collisions, but the restore path only parsed the bare epoch — so on
a same-second collision it compared the whole "<epoch>.<counter>" string
against the integer regex, rejected it, and could restore the wrong (or
no) backup. Split the suffix into <epoch> and <counter>, validate both as
integers, and break ties on the counter so uninstall restores the truly
newest backup.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
VimLeavePre fires too late to pre-empt the E947 "job still running" check
that blocks :qall when a terminal is open. Switch back to QuitPre, but
guard it: count non-terminal ("ordinary") windows and only wipe terminal
jobs when the window being quit is the last one. This threads between both
failure modes — no spurious kills on a single-window or aborted :q, and no
E947 on a real :qall exit. Update the CLAUDE.md Terminal note to match.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The Autocomplete section illustrated triggers as ".", "::", "->", but the
engine matches a single character against b:ivim_complete_triggers and no
ftplugin registers multi-char strings — "::" was deliberately removed
because it froze Rust/Lua/C++ completion. Replace the list with the actual
single-char union across ftplugins: . > : < / $ and space.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.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.

<leader>x (:xall) leaves terminal job running → E948; cleanup only fires on QuitPre

1 participant