Distrobox: emacs: Could not open file: /dev/tty
1
vote
0
answers
324
views
Am currently trying to automate running
emacs
on a Distrobox container (the Docker container is silex/emacs:29.2-alpine
, although I've also tried silex/emacs:29.2
which uses a Debian image), and am getting the error emacs: Could not open file: /dev/tty
. Here's what I'm doing:
distrobox create --name test --image silex/emacs:29.2-alpine --home /home/dbhome
distrobox enter test -nw -- /nix/store/emacs/bin/emacs-29.2
Which produces the mentioned error. However, running first distrobox enter test -nw
, and then running /nix/store/emacs/bin/emacs-29.2
does successfully start emacs
within the distrobox container. The issue is, I want to automate this emacs startup, so I need to find a way that would allow me to startup the emacs from the container from a sequence of commands ran outside the container.
Anyone know what my be causing emacs: Could not open file: /dev/tty
in this way? The reason I'm using Distrobox instead of just a regular container is that I eventually want to use Distrobox's ootb support for connecting to the host's X11 sockets.
EDIT: strace
confirms the error is -1 ENXIO (No such device or address)
EDIT2: The problem subsides if we replace a bit of the docker exec
command ran by distrobox enter
. The docker exec
command ends with CONTAINERNAME su USERNAME -c COMMAND
; the issue gets fixed when we use CONTAINERNAME COMMAND
directly.
Asked by shintuku
(143 rep)
Feb 16, 2024, 09:27 PM
Last activity: Feb 17, 2024, 12:50 AM
Last activity: Feb 17, 2024, 12:50 AM