Repository navigation
fix: iTerm2 cursor blinking issue - #287
Merged
Merged
Conversation
Collaborator
|
Thanks! I see the issue. Problem here is that not hiding the cursor for a frame will make it flicker across the screen for other terminals. I want to use Private Mode 2026, which is supported by iTerm2 as well and would alleviate the flickering. writer.writeAll(ansi.ANSI.syncSet) // "\x1b[?2026h"
// and
writer.writeAll(ansi.ANSI.syncReset) // "\x1b[?2026l"I agree however that setting the cursor color and style when it did not change for every frame should be avoided. |
Contributor
Author
|
I've restored the hide cursor functionality and it still works well in iTerm2. It seems the actual issue was the color change. This would probably be better to add before entering private mode.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes anomalyco/opencode#3780
This can be fixed either by enabling a checkbox in iTerm2 (see anomalyco/opencode#3780 (comment)) or by merging this PR, which prevents showing the cursor ANSI code on every render.
To reproduce, run the following in iTerm2:
Before PR
After PR
This is a really annoying issue in iTerm2.
On Mac, I've also tested this with WezTerm and VS Code Terminal. There is no issue on either, and I've verified that the PR works on both.
In iTerm2, I've also tested that the blinking cursor still works correctly.