[PR #287] [MERGED] fix: iTerm2 cursor blinking issue #423

Closed
opened 2026-03-02 23:46:26 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opentui/pull/287
Author: @istarkov
Created: 11/9/2025
Status: Merged
Merged: 11/10/2025
Merged by: @kommander

Base: mainHead: fix-iterm


📝 Commits (1)

📊 Changes

1 file changed (+24 additions, -2 deletions)

View changed files

📝 packages/core/src/zig/renderer.zig (+24 -2)

📄 Description

Closes https://github.com/sst/opencode/issues/3780

This can be fixed either by enabling a checkbox in iTerm2 (see https://github.com/sst/opencode/issues/3780#issuecomment-3508037343) or by merging this PR, which prevents showing the cursor ANSI code on every render.

To reproduce, run the following in iTerm2:

import { render } from "./index"
import { createEffect, createSignal, onCleanup } from "solid-js"

function ScrollFail() {
  const [increasingText, setIncreasingText] = createSignal("Build")

  createEffect(() => {
    const interval = setInterval(() => {
      setIncreasingText((v) => (v.length > 10 ? "" : v + "a"))
    }, 10)

    onCleanup(() => {
      clearInterval(interval)
    })
  })

  return (
    <box flexDirection="column" gap={1}>
      <box flexShrink={0}>
        <text>{increasingText()}</text>
      </box>
      <box flexShrink={0} borderStyle="single" borderColor={"#f0f"}>
        <textarea
          onMouseDown={(r: MouseEvent) => r.target?.focus()}
          cursorColor={"#00f"}
          focusedBackgroundColor={"#eee"}
          minHeight={2}
          maxHeight={6}
        />
      </box>
    </box>
  )
}

render(() => <ScrollFail />)

Before PR

Screen Recording 2025-11-09 at 23 39 12

After PR

Screen Recording 2025-11-09 at 23 40 35

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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opentui/pull/287 **Author:** [@istarkov](https://github.com/istarkov) **Created:** 11/9/2025 **Status:** ✅ Merged **Merged:** 11/10/2025 **Merged by:** [@kommander](https://github.com/kommander) **Base:** `main` ← **Head:** `fix-iterm` --- ### 📝 Commits (1) - [`7a333d8`](https://github.com/anomalyco/opentui/commit/7a333d80fd09b7bf5d57637edacac2f6fbd15e9b) Hide cursor ### 📊 Changes **1 file changed** (+24 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `packages/core/src/zig/renderer.zig` (+24 -2) </details> ### 📄 Description Closes https://github.com/sst/opencode/issues/3780 This can be fixed either by enabling a checkbox in iTerm2 (see https://github.com/sst/opencode/issues/3780#issuecomment-3508037343) or by merging this PR, which prevents showing the cursor ANSI code on every render. To reproduce, run the following in iTerm2: ```ts import { render } from "./index" import { createEffect, createSignal, onCleanup } from "solid-js" function ScrollFail() { const [increasingText, setIncreasingText] = createSignal("Build") createEffect(() => { const interval = setInterval(() => { setIncreasingText((v) => (v.length > 10 ? "" : v + "a")) }, 10) onCleanup(() => { clearInterval(interval) }) }) return ( <box flexDirection="column" gap={1}> <box flexShrink={0}> <text>{increasingText()}</text> </box> <box flexShrink={0} borderStyle="single" borderColor={"#f0f"}> <textarea onMouseDown={(r: MouseEvent) => r.target?.focus()} cursorColor={"#00f"} focusedBackgroundColor={"#eee"} minHeight={2} maxHeight={6} /> </box> </box> ) } render(() => <ScrollFail />) ``` ## Before PR ![Screen Recording 2025-11-09 at 23 39 12](https://github.com/user-attachments/assets/32534dbf-5760-44c1-8562-fe33e59c9e8d) ## After PR ![Screen Recording 2025-11-09 at 23 40 35](https://github.com/user-attachments/assets/a4c23e9b-52a3-45b6-9b8b-312cc3e5b9de) 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 23:46:26 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/opentui#423
No description provided.