Not a tty
See original GitHub issueDefault shells seem to be limited. For example, the following step:
- run: |
ps
echo "$(tty)"
produces:
PID TTY TIME CMD
2587 ? 00:00:02 Runner.Listener
2611 ? 00:00:02 Runner.Worker
2763 ? 00:00:00 bash
2777 ? 00:00:00 ps
not a tty
As a result, multiple tools that can provide pretty coloured logs do not work as expected. This is the case of e.g. colorama or pytest in the Python ecosystem.
A possible workaround is to use docker run --rm -t ...
. However, this involves installing in the container multiple resources/tools that are already available on the host. Furthermore, I don’t know if windows containers are supported on windows-latest
jobs.
I tried setting shell: bash -i -l {0}
, but I get:
bash: cannot set terminal process group (1291): Inappropriate ioctl for device
bash: no job control in this shell
I tried python -c 'import pty; pty.spawn("/bin/sh")'
too, but the job wil run for more than 10min with no output.
Which is the appropriate syntax to get a TTY?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:83
- Comments:56 (5 by maintainers)
Top Results From Across the Web
Error "The input device is not a TTY"
I am running the following command from my Jenkinsfile . However, I get the error "The input device is not a TTY". docker...
Read more >What does "the input device is not a TTY" exactly mean in ...
What does "the input device is not a TTY" exactly mean in "docker run" output? · It's not redundant, docker can create a...
Read more >SSH inside SSH fails with "stdin: is not a tty"
By default, when you run a command on the remote machine using ssh, a TTY is not allocated for the remote session. This...
Read more >docker-compose exec: the input device is not a TTY #7306
Description of the issue Cannot start interactive shell (e.g. /bin/bash) using docker-compose -f - exec Context information (for bug ...
Read more >docker error in crontab: the input device is not a TTY
when you run a docker command via crontab like below # /usr/bin/docker exec -it containername /path/to/command. you will get “the input device is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@dakale @joshmgross @bryanmacfarlane
On the off chance it helps make the case for re-prioritizing: this is continually externalizing work on users and maintainers.
Every person/team/project that encounters this has to burn time (and, often, GH computational resources) on some combination of:
Once this cascades over into issues filed on other tools/projects, the developers of those projects also have to burn time understanding the issue, deciding whether it’s right for them to address it, and implementing something.
Without a fix, all of these remain ongoing costs.
FYI as a workaround you can use
script -e -c $YOUR_USUAL_COMMAND_HERE
, but this is obviously a bit of a hack.