Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Ghost cursor appears at top-left (0,0) on initialization

オープン
#122 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

@midagedev がすでに取り組んでいます。

2026年8月25日 から。

  • #190 @midagedev による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
typescript
領域
frontend

調査の方向性

lastCursorPosition 周辺の CanvasRenderer の初期化と、1337 行および 1561-1578 行付近で特定されたカーソル描画ロジックを調査してください。Chrome でカーソルを有効にした Terminal を開いて問題を再現し、その後、初期化と続くコンテンツの描画によって、(0,0) に 1 つ表示されるのではなく、実際の位置にカーソルが 1 つだけ残ることを確認してください。

索引モデルが issue の本文から書いたものです。

説明

bug status:could-not-reproduce triage:done

Description

When initializing a Terminal instance, a ghost cursor is rendered at the top-left corner (coordinates 0,0) in addition to the actual cursor position. This cursor persists and doesn't disappear even when the terminal receives content.

Steps to Reproduce

  1. Create a new Terminal instance with cursor enabled
  2. Call terminal.open(container)
  3. Observe that a cursor appears at the top-left corner (0,0)
  4. The ghost cursor remains even after terminal content is rendered

Expected Behavior

Only one cursor should be visible at the actual cursor position, not at (0,0).

Actual Behavior

Two cursors are visible:

  1. The correct cursor at the actual position
  2. A ghost cursor at the top-left corner (0,0)

Root Cause Analysis

After investigating the minified source code, the issue appears to be in CanvasRenderer:

  1. Initialization: lastCursorPosition is initialized to { x: 0, y: 0 } (around line 1337)
  2. Rendering: The cursor rendering logic at line 1561-1578 checks g === 0 && I.visible && this.cursorVisible && this.renderCursor(I.x, I.y)
  3. Problem: When the cursor moves to a new position, the old position (0,0) is not properly cleared, leaving a ghost cursor

Workaround

TBD

Environment

  • ghostty-web version: 0.4.0
  • Browser: Chrome (tested)
  • OS: macOS

Suggested Fix

The CanvasRenderer should either:

  1. Not render the cursor until a valid position is set
  2. Properly clear the initial (0,0) position when the cursor moves
  3. Initialize lastCursorPosition to a sentinel value that prevents initial rendering
主要言語
TypeScript
スター
2.9k
フォーク
182
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

coder/ghostty-web のほかの issue

coder/ghostty-web の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。