Reviewed PR details and related issues.
UnderstandConfirmed cursor visibility behavior on shutdown.
UnderstandNoted push failure due to unstaged changes.
VerifyYou are given one or more GitHub PR URLs: https://github.com/badlogic/pi-mono/pull/800 why does the current code break ime positioning? cant we hide the cursor while still set the cursor position for ime?
For each PR URL, do the following in order:
packages/*/CHANGELOG.md files. Report whether an entry exists. If missing, state that a changelog entry is required before merge and that you will add it if the user decides to merge. Follow the changelog format rules in AGENTS.md. Verify:
### Breaking Changes, ### Added, ### Fixed, etc.)Fixed foo ([#123](https://github.com/badlogic/pi-mono/pull/123) by [@user](https://github.com/user))### Breaking Changes, not just ### FixedOutput format per PR: PR: Changelog:
If no issues are found, say so under Bad and Ugly.
PR: https://github.com/badlogic/pi-mono/pull/800 Changelog:
i think we don't need a setting. we need to differntiate between cursor positioning (always on!) and hardware cursor visibility (toggle via ENV var). can you please check how we can always position the cursor, but make visibility toggleable?
Yes. The current behavior in packages/tui/src/tui.ts short-circuits cursor positioning when useHardwareCursor is false. That means the cursor is never moved, so IME candidate windows anchor to a stale position.
To always position the cursor while making visibility toggleable, split the concerns:
Concrete approach in TUI:
showHardwareCursor = process.env.PI_HARDWARE_CURSOR === "1" or rename the existing useHardwareCursor to showHardwareCursor.positionHardwareCursor, remove the early return that skips movement when the flag is false.cursorPos is available and totalLines > 0, regardless of visibility.showCursor() only if visibility is enabled. Otherwise call hideCursor().Pseudo-change inside positionHardwareCursor:
if (!cursorPos || totalLines <= 0) { this.terminal.hideCursor(); return;}
move cursor to target row and colthis.hardwareCursorRow = targetRow
if (this.showHardwareCursor) this.terminal.showCursor()else this.terminal.hideCursor()That keeps IME positioning stable while allowing visibility control.
If we remove the new coding-agent setting, we should also remove:
We would keep PI_HARDWARE_CURSOR as visibility only. If you want me to implement these changes, say so.
well, we haven't merged the pr yet, so i think we can just make this change in main. we can still. so
agree?
Summary:
Tests not run.
oki, looks great, changelog needs citation of pr and contributor, then commit and push JUST the files you modified
npm run check failed due to an unrelated untracked file: packages/coding-agent/examples/extensions/trigger-compact.ts has an unused import. That file is not part of our changes and is currently untracked.
How do you want to proceed?
Options:
Once confirmed, I will commit and push only these files:
try again npm run check
ok, do we need to enable visibility when the tui is shut down?
Yes, on shutdown we should always show the cursor to restore the terminal. TUI.stop already calls terminal.showCursor, so visibility is restored regardless of showHardwareCursor.
Also, push failed because main is ahead and there are unstaged changes in the worktree from other files. I cannot rebase without addressing those. How do you want to proceed with the rebase and push?
if (!cursorPos || totalLines <= 0) { this.terminal.hideCursor(); return;}
move cursor to target row and colthis.hardwareCursorRow = targetRow
if (this.showHardwareCursor) this.terminal.showCursor()else this.terminal.hideCursor()