Skip to content

Conversation

@Supratim69
Copy link

#1298
Fixes an issue where the cursor style was not properly restored when
exiting crush, particularly affecting terminals like urxvt with tmux.

Previously, when crush exited, the cursor would remain as a pink
vertical bar instead of returning to the user's configured cursor
style (typically a blinking block).

This fix adds a restoreCursor() function that:

  • Resets the cursor style to default (blinking block) using ANSI
    escape sequences
  • Ensures the cursor is visible
  • Is called via defer in both interactive and non-interactive modes

The fix uses the charmbracelet/x/ansi package to send the proper
DECSCUSR escape sequence (CSI 0 SP q) to reset the cursor style
and show the cursor on program exit.

This is my first contribution to this repository. Please let me
know if I'm missing anything or if there are any additional changes
needed to align with project conventions.

@Supratim69 Supratim69 requested a review from a team as a code owner October 24, 2025 20:55
@Supratim69 Supratim69 requested review from raphamorim and tauraamui and removed request for a team October 24, 2025 20:55
@charmcli
Copy link
Contributor

charmcli commented Oct 24, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@Supratim69
Copy link
Author

I have read the Contributor License Agreement (CLA) and hereby sign the CLA.

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.

2 participants