Skip to content

fix(tui): stabilize cursor, Unicode input and resize with real PTY tests - #34

Merged
metaphorics merged 3 commits into
stabilize/01-reproducible-lpeg-buildfrom
stabilize/02-real-terminal-regressions
Sep 21, 2026
Merged

metaphorics merged 3 commits into
stabilize/01-reproducible-lpeg-buildfrom
stabilize/02-real-terminal-regressions

Conversation

@metaphorics

Copy link
Copy Markdown
Collaborator

Terminal stabilization, 2026-09-20

This layer follows stabilize/01-reproducible-lpeg-build (PR #33).
It fixes observed terminal behavior rather than replacing the editor model.

Reproductions and repairs

Public behavior Observed failure Repair
Edit, move, save, quit The terminal cursor stayed hidden after painting. Position and show the composed editor or command-line cursor after every frame.
Unicode input Queued UTF-8 bytes became separate characters. Decode complete scalars after byte-oriented mapping, including quoted K_SPECIAL continuations; retain incomplete input.
Left/right in Insert and command-line modes Cursor movement was ignored; subsequent editing and undo were wrong. Track UTF-8 insertion boundaries and split Insert undo blocks after movement.
Command-line cursor-only updates The RPC cursor position always described the end of the command. Send the current byte position, accounting for displayed control characters.
Resize with immediate keyboard input The smaller grid appeared but keyboard input stopped. Select crossterm's level-triggered use-dev-tty backend. Its poll loop needs a positive timeout; use one millisecond.
Resize while the embedded server polls SIGWINCH interrupted epoll_wait; the server exited with an I/O error. Treat Interrupted as an empty reactor wakeup, preserving timer and signal processing. Other I/O errors still propagate.
Read screen dimensions after resize &columns and &lines retained startup values. Update geometry and screen options through the existing session-owned resize API.
Windows capability negotiation Unix-only polling could not consume emitted probe replies. Keep the Windows path on environment-derived capabilities without sending queries or consuming input.

The resize trace showed both keyboard and signal readiness in one epoll batch.
The old terminal backend returned the resize event before consuming keyboard
readiness; a later edge-triggered poll did not report those unread bytes again.
No delay or retry was added to the test to hide that failure.

Tests

crates/oxvim/tests/tui_e2e.rs launches the actual binary with an embedded
server in a pseudoterminal. A VT parser checks the current screen and cursor,
and file checks compare saved bytes. Each session uses a private home,
configuration, working directory, and document. Deadlines bound waits.
Failures retain an ANSI transcript and screen snapshot; children are killed
and reaped during failed-session cleanup.

Four scenarios cover editing and saving; Unicode, arrows, undo and redo;
command-line insertion and deletion; and shrink/grow with immediate input.
The two existing interactive_pty scenarios also pass. The four new scenarios
passed 20 consecutive runs, totaling 80 successful scenario executions.
A separate traced resize run passed with observed EINTR deliveries.

Focused commands, from the repository root:

unset CARGO_BUILD_BUILD_DIR RUSTC_WRAPPER
export CARGO_TARGET_DIR="$PWD/target" CARGO_BUILD_JOBS=8
cargo test --locked --release -p oxvim --test tui_e2e --test interactive_pty
cargo test --locked --release -p ox-editor --test unicode_input
cargo test --locked --release -p ox-tui
cargo check --locked --target x86_64-pc-windows-msvc -p ox-tui --all-targets

The Windows command was a cross-check on Linux, not a native editor run.
The workflow runs actual Linux PTY tests and native Windows terminal-library
tests, pins action revisions and Rust 1.98.0, and uploads failed PTY artifacts.
It does not label the terminal-library job as full Windows editor coverage.

Broader validation and limits

The first fresh workspace nextest run completed 3,470 tests: 3,461 passed,
nine failed, and one additional test was skipped. Eight failures require a
dynamic tree-sitter parser fixture; the remaining performance-contract test
requires .references/neovim/build/bin/nvim. These failures were not skipped,
marked ignored, or changed into passing tests.

For the parser rerun, the C grammar fixture is tree-sitter-c v0.24.2, archive
SHA-256 2eeb4db31f8fa0865e45488503d13403923bcb485a1bdb637abff8c42dd97364.
Build its src/parser.c as a shared library and set
OXVIM_TREE_SITTER_PARSER to its absolute path and
OXVIM_TREE_SITTER_LANGUAGE=c. Fixture sources belong under target, not
in the product source or the read-only reference checkout.

Workspace all-target Clippy also finds existing denied unwrap_used calls
in ox-text/src/swapfile.rs tests. Focused Clippy completes, with existing
warnings in other library code. No workspace-wide lint allowance was added.

This layer does not establish full Windows editor support, upstream functional
or oldtest parity, or the comparative performance contract. It makes no
throughput or latency-improvement claim. Those gates remain distinct from
passing real-terminal regressions.

@coderabbitai

coderabbitai Bot commented Sep 20, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 26f6a57b-bbc6-450c-85f7-79855c21d62b

📥 Commits

Reviewing files that changed from the base of the PR and between 09e3286 and c1152ae.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (16)
  • .github/workflows/terminal.yml
  • .outline/sdd/reports/2026-09-20-terminal-stabilization.md
  • crates/ox-api/src/ui.rs
  • crates/ox-editor/src/mode.rs
  • crates/ox-editor/src/motion.rs
  • crates/ox-editor/src/ops.rs
  • crates/ox-editor/src/typeahead.rs
  • crates/ox-editor/tests/unicode_input.rs
  • crates/ox-loop/src/reactor.rs
  • crates/ox-tui/Cargo.toml
  • crates/ox-tui/src/lib.rs
  • crates/ox-tui/src/terminal.rs
  • crates/ox-ui/src/emitter.rs
  • crates/oxvim/Cargo.toml
  • crates/oxvim/src/server.rs
  • crates/oxvim/tests/tui_e2e.rs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 20, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-20T21:09:02.429562Z c1152ae Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@amazon-q-developer amazon-q-developer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This PR successfully refactors line number formatting by introducing a centralized format_line_number function. The implementation correctly calculates padding based on total line count and consistently applies it across the codebase. No blocking issues identified.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 23a2e697d6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/ox-editor/src/mode.rs
Comment thread crates/ox-api/src/ui.rs
@metaphorics
metaphorics added this pull request to stack #37 September 20, 2026 21:02
@metaphorics

Copy link
Copy Markdown
Collaborator Author

@codex review

@metaphorics

Copy link
Copy Markdown
Collaborator Author

/q review

@amazon-q-developer amazon-q-developer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

I've completed a thorough review of this PR focusing on the reactor error handling, terminal resize logic, typeahead input handling, and server cursor positioning improvements.

Analysis:
The changes implement solid improvements across multiple areas:

  • Enhanced error reporting in the reactor without panic scenarios
  • Improved terminal resize handling with better cursor positioning
  • Fixed Unicode input handling in the typeahead system
  • Better cursor positioning and rendering in the server

Findings:
The implementation is sound with no critical defects identified. The code follows good practices, maintains consistency with the existing codebase, and the changes are working improvements rather than introducing new issues.

Conclusion:
No blocking issues found. The PR is ready to merge.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: c1152aef86

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@metaphorics
metaphorics merged commit 78285c8 into main Sep 21, 2026
7 checks passed
@metaphorics
metaphorics deleted the stabilize/02-real-terminal-regressions branch September 21, 2026 14:24
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