Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tty: use blocking mode on OS X #6895

Merged
merged 2 commits into from
Jun 1, 2016

Commits on Jun 1, 2016

  1. tty: use blocking mode on OS X

    OS X has a tiny 1kb hard-coded buffer size for stdout / stderr to
    TTYs (terminals). Output larger than that causes chunking, which ends
    up having some (very small but existent) delay past the first chunk.
    That causes two problems:
    
    1. When output is written to stdout and stderr at similar times, the
    two can become mixed together (interleaved). This is especially
    problematic when using control characters, such as \r. With
    interleaving, chunked output will often have lines or characters erased
    unintentionally, or in the wrong spots, leading to broken output.
    CLI apps often extensively use such characters for things such as
    progress bars.
    
    2. Output can be lost if the process is exited before chunked writes
    are finished flushing. This usually happens in applications that use
    `process.exit()`, which isn't infrequent.
    
    See nodejs#6980 for more info.
    
    This became an issue as result of the Libuv 1.9.0 upgrade. A fix to
    an unrelated issue broke a hack previously required for the OS X
    implementation. This resulted in an unexpected behavior change in node.
    The 1.9.0 upgrade was done in c3cec1e,
    which was included in v6.0.0.
    Full details of the Libuv issue that induced this are at
    nodejs#6456 (comment)
    
    Refs: nodejs#1771
    Refs: nodejs#6456
    Refs: nodejs#6773
    Refs: nodejs#6816
    PR-URL: nodejs#6895
    Reviewed-By: Rod Vagg <[email protected]>
    Reviewed-By: Anna Henningsen <[email protected]>
    Fishrock123 committed Jun 1, 2016
    Configuration menu
    Copy the full SHA
    98de4ab View commit details
    Browse the repository at this point in the history
  2. test: test TTY problems by fakeing a TTY using openpty

    Many thanks to thefourtheye and addaleax who helped make the python
    bits of this possible.
    
    See nodejs#6980 for more info regarding
    the related TTY issues.
    
    Refs: nodejs#6456
    Refs: nodejs#6773
    Refs: nodejs#6816
    PR-URL: nodejs#6895
    Reviewed-By: Rod Vagg <[email protected]>
    Reviewed-By: Anna Henningsen <[email protected]>
    Fishrock123 committed Jun 1, 2016
    Configuration menu
    Copy the full SHA
    88804b8 View commit details
    Browse the repository at this point in the history