-
-
Notifications
You must be signed in to change notification settings - Fork 1
TTY Allocation
Whether wip passes -it to wslc — and therefore whether you get an interactive terminal — is
decided by combining three things.
TTY allocated = (config says interactive) AND (CLI didn't say otherwise) AND (stdin and stdout are both real TTYs)
All three must hold. Any one of them false means no -it.
| Input | Where it comes from |
|---|---|
| Config |
interactive: on the interaction, or on the dependencies: entry |
| CLI |
--no-interactive on exec / run (interactive is the default flag value) |
| Reality | both $stdin and $stdout report as TTYs |
| Context | Default interactive
|
|---|---|
dependencies: entry |
false |
interaction: entry |
false |
wip exec / wip run CLI flag |
true (disable with --no-interactive) |
wip shell |
true |
wip up (attached, i.e. no -d) |
true |
wip up -d |
false |
So wip exec bash gets a TTY in a terminal, but wip rspec (an interaction with no
interactive: true) does not — unless you ask for it:
interaction:
rails:
command: bin/rails
interactive: true # needed for `wip rails console`
rspec:
command: bundle exec rspec # no TTY neededBecause wip verifies that both streams are real TTYs, this behaves correctly with no extra flags:
wip rspec # interactive terminal → TTY if configured
wip rspec | tee out.txt # stdout is a pipe → no TTY
wip rspec > out.txt # same
echo y | wip exec bin/thing # stdin is a pipe → no TTYIn CI, neither stream is a TTY, so nothing is allocated even if interactive: true is set. You
generally don't need --no-interactive in CI — though passing it is harmless and explicit. See
Using wip in CI.
Under compose-native mode, those keys are accepted and silently ignored.
TTY allocation is a per-invocation decision — wip rspec and wip rails console against the same
service want different answers — not a fixed property of a service. See
Compose File Support.
When a TTY is allocated, wip runs the child behind a pseudo-terminal rather than piping its streams:
- the child gets a genuine controlling terminal: job control,
Ctrl-C→SIGINT,isatty()-gated colored output all work - output still routes through wip first, so error hints can be generated — inherited file descriptors would bypass wip entirely
- wip's own terminal switches to raw mode so only the pty echoes your keystrokes
- the pty is sized to your terminal and re-synced on
SIGWINCH, soless/vim/htoprender correctly across a window resize
Without a TTY, streams are piped and pumped, which closes the child's stdin immediately — fine for
rspec, fatal for rails console.
On native Windows there's no openpty, so wip lets the child inherit its real stdio instead.
Everything still works; wip just can't observe the output, so no error hints on that path.
The bridge inverts the flag: -T (disable pseudo-TTY) is added when non-interactive, matching
the Compose CLI's own convention.
--debug shows the resolved command, -it included or not:
wip: [debug] running: wslc.exe exec -it -w /app app bin/rails c
wip: [debug] running: wslc.exe exec -w /app app bundle exec rspecIf a console exits immediately with an EOF-ish error, that's a missing -it — check
interactive: true and whether your terminal is really a TTY.
Introduction
Modes
Configuration
- Configuration Reference
- Config File Discovery
- Dependencies
- Networking
- Interactions
- Restart Policies
- Env Files
- Secret Masking
- Dockerignore
- Shadow Build Context
- Source Sync
- Sync Modes
compose.yml support
- Compose File Support
- Compose Build
- Compose Depends On
- Compose Profiles
- Compose Variable Interpolation
Commands
- CLI Command Reference
- wip init
- wip version
- wip doctor
- wip config
- wip build
- wip up
- wip stop
- wip down
- wip exec
- wip run
- wip shell
- wip logs
- wip sync
- wip dispatch
- Global Options
- Debug Output
- TTY Allocation
Guides
- Guides
- Migrating from dip
- Reusing an Existing compose.yml
- Fixing a Slow Boot
- Continuous Sync
- Auto Restarting Containers
- Multi Arch Images
- Using wip in CI
Troubleshooting
- Troubleshooting & FAQ
- FAQ
- Configuration Errors
- WSLC Not Found
- Registry Authentication
- Architecture Mismatch
- Volume Limit Reached
- rsync Not Found
- Reporting Issues
Comparison
Project