fix+add Test case: Message box isn't displayed in the terminal on macOS/Darwin (#861) #981
+9,235
−436
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
This PR fixes issue #861 where the terminal message box fails to display properly, particularly on macOS/Darwin 24.4.0 systems.
Why?
Without this fix, users on macOS/Darwin systems:
Cannot see what they're typing in the terminal input box.
Only see the message box when the process is killed.
Experience the tool as practically unusable.
How?
In terminal-chat-input.tsx:
Enhanced terminal input handling:
Added proper TTY detection and raw mode error handling.
Implemented explicit cursor visibility control via \x1b[?25h.
Ensured input state resets reliably on component activation.
In multiline-editor.tsx:
Improved macOS support:
Refined ref / unref methods to work properly in Node environments.
Added specific handling for Darwin platforms.
Fixed stdin event emission to support proper terminal rendering.
Tests Added:
Verified input box renders correctly across platforms.
Ensured border characters display properly.
Confirmed cursor visibility control executes on Darwin systems.