Regression in 6.2.0: device monitor rejects piped stdout even when stdin is a TTY
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python
- Domain
- cli, embedded-iot
Research direction
Start with platformio/device/monitor/terminal.py, especially new_terminal(), and platformio/compat.py where is_terminal() is defined. Trace how the monitor checks terminal input and review the existing coverage for the guard added in #5503. Add coverage for TTY stdin with piped stdout and confirm the monitor accepts that case while still rejecting non-TTY stdin.
Written by the indexing model from the issue text.
Description
- PlatformIO Core
Configuration
- Operating system: macOS 26.6 (arm64)
- PlatformIO Core: 6.2.0
Steps to reproduce
From an interactive terminal, run:
pio device monitor --port loop:// | cat
loop:// avoids requiring a physical serial device. Only stdout is piped; stdin remains attached to the terminal. The same error occurs when piping a real device's output to jq.
Actual result
The monitor refuses to start:
UserSideException: `pio device monitor` requires an interactive terminal on stdin and cannot run with piped or redirected input. If you're scripting device I/O, talk to the serial port directly instead (e.g., with pyserial) rather than through `pio device monitor`.
Expected result
The monitor starts, reads keyboard input from the terminal, and writes its output to the pipe. It should still reject input that is not a TTY, as intended by #5503.
Additional information
In 6.2.0, new_terminal() calls is_terminal(), which checks sys.stdout.isatty(). That returns False for the pipe even though sys.stdin.isatty() is True. The guard was added in #5503 and is absent in 6.1.19.
Could the monitor check stdin specifically and add coverage for TTY stdin with piped stdout?
- Dominant language
- Python
- Stars
- 9.6k
- Forks
- 916
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from platformio/platformio-core
-
Toolchain include order from DumpIntegrationIncludes depends on directory order (unsorted glob)Possibly taken @Leooo21 claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
platformio/platformio-core#5555 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
platformio/platformio-core#5554 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
platformio/platformio-core#5552 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
platformio/platformio-core#5553 ·
Maintainers usually reply within 1 day
-
Feature suggestion: build_src_unflagsPossibly taken @hariomkhonde108 claimed this 8 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 62/100
platformio/platformio-core#5547 · 1 comment ·
Maintainers usually reply within 1 day
All issues in platformio/platformio-core
Similar issues
-
docs(contributing): the two things that silently block a PRPossibly taken A pull request linked to this issue is open or already merged. Openavailable documentation good first issue
Difficulty 1/5 1-3 hours Newbie friendliness 95/100
Nixitov/Riptide-Native#944 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
JTHCode/secretguard#24 ·
Maintainers usually reply within 1 day
-
area: middleware documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
good first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
omarelshamy25x/shamy-hijri#63 ·
Maintainers usually reply within 1 day