Skip to content

fix: Suppress dumb terminal warning when no streams are TTYs (backport)#1704

Merged
gnodet merged 1 commit intojline-3.xfrom
backport/jline-3.x/suppress-dumb-terminal-warning-no-tty
Mar 18, 2026
Merged

fix: Suppress dumb terminal warning when no streams are TTYs (backport)#1704
gnodet merged 1 commit intojline-3.xfrom
backport/jline-3.x/suppress-dumb-terminal-warning-no-tty

Conversation

@gnodet
Copy link
Copy Markdown
Member

@gnodet gnodet commented Mar 18, 2026

Backport of #1703 to jline-3.x.

Summary

  • Suppress the "Unable to create a system terminal" warning when providers are available but detect that no streams are TTYs (expected in CI environments)
  • Keep the warning when no providers could be loaded at all (can't determine TTY status, indicates a genuine configuration issue)
  • Add tests verifying both scenarios

Context

When JLine is used in CI environments (like GitHub Actions), the warning "Unable to create a system terminal, creating a dumb terminal" is emitted even though falling back to a dumb terminal is the expected behavior when no TTY is available. This creates noise in build logs (e.g., https://github.com/apache/camel/actions/runs/23203983845/job/67434869843#step:11:68).

The fix distinguishes three cases:

  • CI (no TTY), providers loadednoTty=true, providers not empty → warning suppressed
  • Real terminal, providers failed to loadproviders.isEmpty()=true → warning fires
  • Real terminal, providers loaded, but terminal creation failednoTty=false → warning fires

Test plan

  • DumbTerminalWarningTest.testNoWarningWhenNoTtyAndProvidersAvailable — verifies no warning in CI-like environments
  • DumbTerminalWarningTest.testWarningWhenNoProvidersLoaded — verifies warning when no providers are available

When running in environments without a TTY (e.g., CI), the "Unable to
create a system terminal" warning is expected and unhelpful. This change
suppresses the warning when providers are available but detect that no
streams are TTYs, while still warning when no providers could be loaded
(indicating a genuine configuration issue).
@gnodet gnodet merged commit 23e33da into jline-3.x Mar 18, 2026
9 checks passed
@gnodet gnodet added this to the 3.30.9 milestone Mar 31, 2026
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