Probe /dev/tty by opening it, not by testing permission bits - #5
Merged
Conversation
[ -r /dev/tty ] passes in environments where the device exists but cannot be opened (macOS reports 'Device not configured' only on open). The installer then tried to prompt anyway: three open errors and a retry loop instead of the clean 'no terminal — set QBRAID_API_KEY and re-run' message. Verified both directions: under a real pty (script(1)) the probe yields /dev/tty; with the unopenable device it yields empty and the installer dies with the instruction.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found during the local delete-and-reinstall pass.
[ -r /dev/tty ]passes in environments where the device exists but cannot be opened (open fails with 'Device not configured'), so the installer tried to prompt anyway — three open errors and a retry loop instead of the clean 'no terminal available for input. Set QBRAID_API_KEY and re-run.' message.Verified both directions locally: under a real pty (
script(1)) the probe yields/dev/ttyso interactive prompts still work; with the unopenable device it yields empty and the installer exits with the instruction. All local suites pass: shellcheck, bash 3.2 parse, statusline 12/12, extractors 5/5.