Skip to content

Centralize injectable platform facts used by detection and providers #356

Description

@stalep

Review of terminal-detect, terminal-api, and terminal-tty at 859020a6 on 2026-09-28.

Review item: Design 5: platform context
Priority: P2
Evidence: Duplicated platform/environment decisions confirmed in source.

Problem / scope

OSUtils, TerminalDetector, IdeThemeDetector and native transports use different
mixtures of static OS constants, environment scans, system properties and
runtime handle checks. This complicates cross-host tests and can conflate an
environment hint with proof that a particular descriptor is a terminal.

Evaluate a small immutable/injectable platform context with live descriptor
checks at the I/O boundary. Do not assume a wholesale public OSUtils move is
required or create a terminal-detect -> terminal-api dependency.

Source at the reviewed commit

Acceptance criteria

  • Identify shared facts versus transport-specific live checks and choose a dependency-compatible home.
  • Support host-independent OS/env/path test matrices without mutating JVM-global properties.
  • Preserve public compatibility where practical and reduce repeated scans; keep the Java 8 baseline.

Tracking

Part of #300. Related: #296, #329, #330, #343, #347.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions