NoiseByNorthwest / term-asteroids

An Asteroids-like game, running in a terminal, written in PHP
MIT License
36 stars 2 forks source link

macOS xterm error `Can't open display` #4

Open tuqqu opened 1 year ago

tuqqu commented 1 year ago

macOS 13.3.1 Docker version 20.10.14

> make run                                                                                                                                 
if [[ ! $(docker images | grep term-asteroids) ]]
then
make build
fi
if [[ ! $(docker ps | grep term-asteroids) ]]
then
if [[ $(docker ps -a | grep term-asteroids) ]]
then
docker rm term-asteroids
fi
docker run -d \
        -e DISPLAY=:0 \
        -v /tmp/.X11-unix:/tmp/.X11-unix \
        -v $(pwd):/var/www/html \
        -p 8000:8000 \
        --name term-asteroids term-asteroids \
        bash -c "sleep 3650d"
fi
if [[ ! -d vendor ]]
then
docker exec -it \
        term-asteroids \
        bash -c 'cd /var/www/html && ./install-composer.sh'
fi
docker exec -it \
    term-asteroids \
    /usr/bin/env LANG=C.UTF-8 /usr/bin/xterm -maximized -T TermAsteroids \
    -e 'php -dzend.assertions=-1 index.php --use-native-renderer || sleep 20'
/usr/bin/xterm: Xt error: Can't open display: :0
make: *** [Makefile:51: run] Error 1
NoiseByNorthwest commented 1 year ago

There are common issues with X11 forwarding on mac. You may find some help by looking at these links: https://gist.github.com/sorny/969fe55d85c9b0035b0109a31cbcb088 https://gist.github.com/cschiewek/246a244ba23da8b9f0e7b11a68bf3285 https://stackoverflow.com/questions/38686932/how-to-forward-docker-for-mac-to-x11?noredirect=1&lq=1