Skip to content

Fix the query editor cursor sweep on terminals without synchronized output - #359

Open
sungmpar wants to merge 1 commit into
Maxteabag:mainfrom
sungmpar:fix/query-cursor-unsynchronized-output
Open

sungmpar wants to merge 1 commit into
Maxteabag:mainfrom
sungmpar:fix/query-cursor-unsynchronized-output

Conversation

@sungmpar

Copy link
Copy Markdown

Addresses the visible cursor sweep in #358.

What happens

When the query editor enters INSERT mode, sqlit shows the hardware cursor and suppresses TextArea’s own cursor. On a terminal without synchronized output, the hardware cursor stays visible while Textual moves it to paint other parts of the screen.

Change

Only show the hardware bar cursor when Textual has detected synchronized output. Otherwise, let TextArea paint the cursor using sqlit's existing INSERT-mode styling. Use the active hardware cursor state when deciding whether to draw the TextArea cursor so a late capability reply cannot leave the editor without a cursor.

Verification

  • Added a UI regression that enters INSERT mode, types a character and leaves INSERT mode. It checks the driver’s cursor visibility sequences and the widget cursor for both capability states. On unmodified main the unsynchronized case fails and the synchronized control passes. Both pass with this change on Textual 8.2.8 and 6.10.0.
  • Ran the same sqlit --mock=sqlite-demo session in PuTTY's Unix terminal emulator, pterm 0.83, at 100 × 32 cells. Before this change each of three keystrokes produced 180 absolute cursor moves across 30 rows while the hardware cursor was visible outside synchronized output. After this change each produced zero. The terminal still receives repaint data.
  • Connected the TUI to a real SQLite file in pterm, typed and executed a SELECT and verified the stored value appeared in the results grid.
  • 16 focused editor tests passed. The SQLite integration and CLI subprocess suites had 35 passes and 6 SQLite-specific skips. The unit suite had 1,314 passes and 3 optional-driver skips. Ruff, focused mypy and the package build passed.

The Windows PuTTY and MobaXterm clients were not exercised. This change touches the query editor widget and its tests. No database adapter was modified.

Prepared with AI assistance.

This branch has not been deployed

No deployments
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.

1 participant