Skip to content

fix(purge): restore cursor when purge exits early#926

Closed
YuanHanzhong wants to merge 1 commit into
tw93:mainfrom
YuanHanzhong:fix/purge-restore-cursor
Closed

fix(purge): restore cursor when purge exits early#926
YuanHanzhong wants to merge 1 commit into
tw93:mainfrom
YuanHanzhong:fix/purge-restore-cursor

Conversation

@YuanHanzhong
Copy link
Copy Markdown

Summary

  • Restore the cursor from a cleanup trap after mo purge hides it.
  • Preserve the purge command exit status while still running cleanup.
  • Add a focused regression test for early purge exit after cursor hide.

Testing

  • bash -n bin/purge.sh tests/purge.bats
  • shellcheck --rcfile .shellcheckrc bin/purge.sh tests/purge.bats
  • BATS_FORMATTER=tap bats tests/purge.bats -f "mo purge restores cursor when purge exits after hiding it"
  • git diff --check

Notes

  • The full tests/purge.bats suite still has two unrelated tilde-expansion failures on upstream main.

Fixes #915

@YuanHanzhong YuanHanzhong requested a review from tw93 as a code owner May 18, 2026 14:03
@tw93
Copy link
Copy Markdown
Owner

tw93 commented May 22, 2026

@YuanHanzhong Thanks for jumping on this cursor restore bug. I merged #928, which covers the same #915 issue and also keeps the existing temp-file cleanup trap intact across exit paths. Closing this one as a duplicate so we do not carry two competing implementations for the same fix.

@tw93 tw93 closed this May 22, 2026
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.

[BUG] Mole - Purge command can't show_cursor

2 participants