Skip to content

feat(api): add BashBuilder::tty() for configurable terminal detection#830

Merged
chaliy merged 1 commit intomainfrom
fix/issue-799-tty-fd-api
Mar 26, 2026
Merged

feat(api): add BashBuilder::tty() for configurable terminal detection#830
chaliy merged 1 commit intomainfrom
fix/issue-799-tty-fd-api

Conversation

@chaliy
Copy link
Copy Markdown
Contributor

@chaliy chaliy commented Mar 26, 2026

Summary

  • Add BashBuilder::tty(fd, is_terminal) method for configuring terminal detection
  • [ -t fd ] and [[ -t fd ]] now respect per-FD configuration
  • Defaults remain false (non-interactive) for all FDs in sandbox

Test plan

  • tty_defaults_to_false — default behavior unchanged
  • tty_configurable_via_builder — stdin/stdout configurable, unconfigured FDs still false
  • tty_test_builtin_bracket[ -t ] single-bracket also works
  • Full test suite passes

Closes #799

Closes #799 — add tty(fd, is_terminal) method to BashBuilder that
configures whether [ -t fd ] reports a file descriptor as a terminal.

Defaults remain false (non-interactive) for all FDs in the sandbox.
The internal _TTY_N variable mechanism already existed; this exposes
it through the public builder API.
@chaliy chaliy merged commit 4013c4c into main Mar 26, 2026
18 of 23 checks passed
@chaliy chaliy deleted the fix/issue-799-tty-fd-api branch March 26, 2026 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test builtin: [[ -t fd ]] always returns false

1 participant