Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#122 4 bình luận 0 reaction 0 người được giao Xem trên GitHub

@midagedev đang làm issue này rồi.

Từ ngày 25/8/2026.

  • #190 của @midagedev — đang mở

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
68/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
typescript
Lĩnh vực
frontend

Hướng nghiên cứu

Kiểm tra quá trình khởi tạo CanvasRenderer xung quanh lastCursorPosition và logic kết xuất con trỏ được xác định gần các dòng 1337 và 1561-1578. Tái hiện vấn đề bằng cách mở một Terminal bật con trỏ trong Chrome, sau đó xác minh rằng quá trình khởi tạo và kết xuất nội dung tiếp theo chỉ để lại một con trỏ ở vị trí thực tế thay vì một con trỏ ở (0,0).

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
Ngôn ngữ chính
TypeScript
Star
2.9k
Fork
182
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của coder/ghostty-web

Tất cả issue của coder/ghostty-web

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.