Ghost cursor appears at top-left (0,0) on initialization
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 68/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- typescript
- 領域
- frontend
調査の方向性
lastCursorPosition 周辺の CanvasRenderer の初期化と、1337 行および 1561-1578 行付近で特定されたカーソル描画ロジックを調査してください。Chrome でカーソルを有効にした Terminal を開いて問題を再現し、その後、初期化と続くコンテンツの描画によって、(0,0) に 1 つ表示されるのではなく、実際の位置にカーソルが 1 つだけ残ることを確認してください。
索引モデルが issue の本文から書いたものです。
説明
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
- Create a new Terminal instance with cursor enabled
- Call
terminal.open(container) - Observe that a cursor appears at the top-left corner (0,0)
- 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:
- The correct cursor at the actual position
- 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:
- Initialization:
lastCursorPositionis initialized to{ x: 0, y: 0 }(around line 1337) - Rendering: The cursor rendering logic at line 1561-1578 checks
g === 0 && I.visible && this.cursorVisible && this.renderCursor(I.x, I.y) - 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:
- Not render the cursor until a valid position is set
- Properly clear the initial (0,0) position when the cursor moves
- Initialize
lastCursorPositionto a sentinel value that prevents initial rendering
- 主要言語
- TypeScript
- スター
- 2.9k
- フォーク
- 182
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
coder/ghostty-web のほかの issue
-
buffer translateToString()/getChars() return '' for empty cells, collapsing cursor-positioned textオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
coder/ghostty-web#205 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
coder/ghostty-web#204 ·
-
Alt+<printable key> sends the bare key with no ESC prefix (readline/emacs/tmux meta bindings lost)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
coder/ghostty-web#203 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
coder/ghostty-web#199 ·
-
Public buffer getChars and translateToString truncate multi-codepoint graphemes対応中かも @schickling-assistant が 10 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 76/100
coder/ghostty-web#200 ·
coder/ghostty-web の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
homarr-labs/dashboard-icons#2939 ·
メンテナーはふだん 1 日以内に返信
-
Agent/category reasoning variants are still checked against the stale model cache in chat.paramsオープンopencode
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
code-yeongyu/oh-my-openagent#10003 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
メンテナーはふだん 1 日以内に返信
-
Actions on Toastsオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
nextcloud-libraries/nextcloud-dialogs#2669 ·
メンテナーはふだん 1 日以内に返信