Visitar URL original
Not all versions of Linux have /bin/test · Issue #839 · jline/jline3 · GitHub
Skip to content

Not all versions of Linux have /bin/test #839

Closed

Description

@lahodaj

The org.jline.terminal.impl.exec.ExecTerminalProvider uses a test program to detect if a stream is attached to a terminal:

Process p = new ProcessBuilder(OSUtils.TEST_COMMAND, "-t", Integer.toString(stream.ordinal()))

The test program appears to be hardcoded to /bin/test:

But, there appear to be some versions of Linux that use /usr/bin/test rather than /bin/test, which then leads to misdetection of the terminal streams as non-terminal, and then JLine won't switch to raw mode, and input does not work properly.

Inside OpenJDK, this lead to:
openjdk/jdk@fab2357

Activity

  1. gnodet commented on Mar 29, 2023

    @gnodet
    Member

    Maybe using something like:

    test = Files.exists(Paths.get("/bin/test")) ? "/bin/test" : "/usr/bin/test";
    
  2. added this to the milestone on Jul 31, 2023
  3. added a commit that references this issue on Jul 31, 2023
    2428bb6
  4. added a commit that references this issue on Aug 1, 2023
    1ac766f
  5. modified the milestones: , 3.23.1 on Aug 29, 2023
  6. modified the milestones: 3.23.1, 3.24.0 on Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions