Open
Description
Default 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?