phyver / GameShell

a game to learn (or teach) how to use standard commands in a Unix shell
GNU General Public License v3.0
2.12k stars 135 forks source link

Mission 18 Mac OS Issue: The variable DISPLAY is not defined. #128

Closed COValhalla closed 1 week ago

COValhalla commented 1 year ago

I've had no issues on Mac OS up until Mission 18 where I received the following error:

You are back in the cellar. The variable DISPLAY is not defined. A running X server is required for mission intermediate/04_bg_xeyes/init.sh. Error: mission 18 is cancelled because some dependencies are not met.

Since Mac OS does not use the X Window System natively, I had to install XQuartz and set DISPLAY with `export DISPLAY=:0

Once you start XQuartz, Mission 18 almost works completely. Whenever I run xeyes & and then Control-C, ultimately followed by gsh check I receive a mission failure.

For a path forward, we should be able to add XQuartz to the brew install command. Then, the trick is how/where do we want to instruct the student to run XQuartz? Should we add a check to see if XQuartz is running, if not tell the student to start it?

Or do we find a different way to teach COMMAND & that doesn't rely on X Window System?

COValhalla commented 1 year ago

I ran into some issues and had to do a fresh install. This time around I was able to complete Mission 18.

Note: It would be really nice if we knew what the password was to skip/go-to levels.

phyver commented 1 year ago

I want to (whenever I find the time and a good idea) be able to write a mission about foreground / background processes that doesn't rely on X. Maybe now is the time...

Can you confirm that running

  $ brew install --cask xquartz
  $ export DISPLAY=:0
  $ ./gameshell.sh

works as expected? If so, I can add that to the README.

phyver commented 1 year ago

Note: It would be really nice if we knew what the password was to skip/go-to levels.

Right, it should be documented! (But maybe not on the main page...) The default password is gsh. You can also run GameShell in debug mode, and no password is necessary when running admin commands.

shaleh commented 1 week ago

All you need is a long running process. It could sleep, it could run find across all of /proc.....

Run this command in the background `xyz` in the background.

$ gsh check  # looks for the command in ps output
phyver commented 1 week ago

All you need is a long running process. It could sleep, it could run find across all of /proc.....

Run this command in the background `xyz` in the background.

$ gsh check  # looks for the command in ps output

I'm not sure what to make of your comment, but I just pushed 2 new missions about background jobs and Control-C. The default GameShell archives still has the xeyes mission (but it is skipped if xeyes isn't available), but then goes to a pure CLI mission about background jobs and another one about using Control-C to stop a process.