Skip to content

fix: Linux PENDIN termios constant is incorrect #1833

@gnodet

Description

@gnodet

Description

In LinuxTermiosMapping.java, the PENDIN local flag constant is incorrect.

Current value (wrong):

private static final int PENDIN = 0x0002000;  // = 8192

Correct value (from Linux asm-generic/termbits.h):

private static final int PENDIN = 0x0004000;  // = 16384

The Linux kernel defines PENDIN as octal 0100000 = hex 0x4000, but the code has 0x2000.

Impact

Currently low — JLine uses this constant symmetrically in toTermios() and toAttributes(), so the wrong value roundtrips correctly. However, if JLine ever needs to interoperate with termios structs set by other programs (e.g. reading terminal state set by the shell), this flag would be silently lost.

Origin

This is a pre-existing bug inherited from LinuxNativePty.java. It was copied as-is during the refactor in #1828.

File

terminal-jni/src/main/java/org/jline/terminal/impl/jni/linux/LinuxTermiosMapping.java line 100

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions