Skip to content

fix: skip startup cursor query - #264

Merged
RivoLink merged 1 commit into
RivoLink:mainfrom
AbhiTheModder:fix/cursor
Aug 31, 2026
Merged

fix: skip startup cursor query#264
RivoLink merged 1 commit into
RivoLink:mainfrom
AbhiTheModder:fix/cursor

Conversation

@AbhiTheModder

Copy link
Copy Markdown
Contributor

When ratatui 0.30's terminal.clear() was called right after entering alternate screen mode, the internal get_cursor_position() call sent a `\x1b[6n` (DSR) query that arrived before crossterm's event system was ready, causing a timeout and the raw response ^[[1;1R to appear on screen. Replace it with clear_region(ClearType::All) on the backend directly, which skips the unnecessary cursor save/restore at this point in the startup sequence.

@AbhiTheModder

Copy link
Copy Markdown
Contributor Author

just in case, below is the error that happens:

╰─> leaf test.md
^[[1;1RError: The cursor position could not be read within a normal duration

@RivoLink RivoLink left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,
Thank you for your interest in the project and for this PR.

I have a few requests:

  • Fix the CI check failure, may be: fix: skip startup cursor query
  • GPG signing is required on the main branch, so if you can sign it, great. If not, no worrie, I'll handle it while preserving you as the author.

GPG signing docs : https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits

Thanks!

@AbhiTheModder AbhiTheModder changed the title fix: avoid cursor position query on terminal clear fix: skip startup cursor query Aug 31, 2026
@AbhiTheModder

Copy link
Copy Markdown
Contributor Author

Hi @RivoLink,

  1. Done, thanks :)
  2. Didn't saw anywhere in contributing docs about that, well I lose my keys a lot so I have left using gpg keys, would appreciate it you doing so :)

@RivoLink

Copy link
Copy Markdown
Owner

Hi,
Thank you so much!

I’ve signed the commit.
You’re right, I forgot to mention GPG signing in CONTRIBUTING.md. I’ll add it.

Thanks again for this PR, I really appreciate it!

@RivoLink
RivoLink merged commit de47c8d into RivoLink:main Aug 31, 2026
1 check passed
@AbhiTheModder
AbhiTheModder deleted the fix/cursor branch August 31, 2026 18:57
@RivoLink RivoLink linked an issue Sep 3, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to open any files in wezterm terminal

2 participants