Skip to content

fix: backport bugfixes from master to 4.0.x#1840

Merged
gnodet merged 7 commits into
4.0.xfrom
backport/4.0.x/bugfixes
Apr 27, 2026
Merged

fix: backport bugfixes from master to 4.0.x#1840
gnodet merged 7 commits into
4.0.xfrom
backport/4.0.x/bugfixes

Conversation

@gnodet
Copy link
Copy Markdown
Member

@gnodet gnodet commented Apr 27, 2026

Summary

Backport of bugfixes from master to the 4.0.x release branch:

Test plan

  • Full build passes (./mvx mvn install -DskipTests)
  • All tests pass for affected modules
  • Spotless formatting applied

Elec332 and others added 7 commits April 27, 2026 14:22
* Fix AttributedStyle color chaining

* Update terminal/src/test/java/org/jline/utils/AttributedStyleTest.java

* Update terminal/src/test/java/org/jline/utils/AttributedStyleTest.java

---------

Co-authored-by: Guillaume Nodet <gnodet@gmail.com>
…1813)

When a LineDisciplineTerminal is created with a null masterOutput
(e.g. via TerminalBuilder.builder().system(false).build()), closing
the terminal triggers a NullPointerException in FilteringOutputStream's
flush() and close() methods. Add null guards for masterOutput in all
code paths.
…) (#1811)

Deprecate the public dispose() method and update all callers to use
close() instead, which properly handles all cleanup via doClose().
…#1808) (#1817)

On macOS, closing a file descriptor from one thread does not reliably
unblock a read() blocked on the same fd in another thread. The pumpOut
thread in PosixPtyTerminal blocks on masterInput.read(), and pty.close()
was unable to unblock it.

Fix by closing the slave output first, which signals EOF on the master
side via the kernel's PTY layer, reliably unblocking pumpOut on all
platforms. Also close masterInput directly before pty.close().

Restore try-with-resources in FfmTest now that terminals close cleanly.
…image (#1802)

* fix: register all FFM foreign function signatures for GraalVM native-image

Add missing downcall/upcall entries in reachability-metadata.json for
sigaction, Kernel32 Windows APIs, and FfmSignalHandler's signalReceived
upcall. Goes from 6 downcalls/0 upcalls to 16 downcalls/1 upcall.

Four Kernel32 entries using struct-by-value COORD are excluded because
GraalVM's metadata parser does not support nested arrays.

Also add native-image CI job testing both FFM and JNI profiles on
ubuntu and macOS with GraalVM CE 25.

* fix: add exec provider fallback to native-image --check mode

* fix: enhance native-image --check with provider and terminal integration tests

Exercise FFM downcalls via isSystemStream() and verify terminal
creation with TerminalBuilder.

* fix: suppress S106 SonarCloud warning in Graal check() method

* fix: correct import ordering in Graal.java
Redirect and input redirect paths were parsed via Paths.get() in the
default FileSystem. They are now resolved against the session's working
directory so that relative paths resolve correctly and absolute paths
inherit the session's FileSystem.

(cherry picked from commit 699c202)
…nal (fixes #1821) (#1822)

The MasterOutputStream in VirtualTerminal used Charset.defaultCharset() to
decode bytes, which on Windows is typically Windows-1252 instead of UTF-8.
This caused multi-byte UTF-8 characters like the ellipsis (U+2026) to be
garbled, making StatusTest.testStatusLineTruncation fail on Windows.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 27, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 08ec21c6-ca16-437a-b691-2eda659bb872

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch backport/4.0.x/bugfixes

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 and usage tips.

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
9.4% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@gnodet gnodet merged commit acc413c into 4.0.x Apr 27, 2026
14 of 15 checks passed
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.

2 participants