1

I have a CI script that is run in a non-interactive docker container. One of the applications I use (emacs in batch mode) expects a TTY, even though it is never going to read from it.

In interactive mode, I can pipe /dev/tty to the application, but in non-interactive mode the device doesn't even exist!

How can I create a fake terminal in a non-interactive docker container?

BTW, I do not have control over the CI runner (drone) which starts the script... so I cannot add -i or -t

Running ls -R /dev gives

/dev:
fd
full
fuse
kcore
mqueue
null
ptmx
pts
random
shm
stderr
stdin
stdout
tty
urandom
zero

/dev/mqueue:

/dev/pts:
ptmx

/dev/shm:
fommil
  • 5,757
  • 8
  • 41
  • 81

1 Answers1

1

Try to wrap the invocation of your script in a script (literally) invocation. There's a similar problem when su'ing to another user, and then accessing a screen session.

$ script /dev/null
$ emacs ...
$ exit

See also https://serverfault.com/a/116830

Community
  • 1
  • 1