GithubHelp home page GithubHelp logo

Comments (4)

phyver avatar phyver commented on August 25, 2024 2

Is that better? (ad871b1)

[mission 1] $ cd .. 

You left GameShell's directory structure. Use
  $ cd
to go back to the GameShell's starting directory.

[mission 1] $ 

from gameshell.

phyver avatar phyver commented on August 25, 2024

You can go outside of GameShell, but I don't see a way around that. (Using chroot would require root access, and "importing" /usr/bin and all the rest.)

I decided to protect the base directory as it contains things I don't want the player to see: the GameShell source files and directories, temporary files, etc. That's to prevent the player from messing with those files by accident.
You can always go back to GameShell's root directory with cd as the $HOME variable is set accordingly.
("root directory" = $HOME = starting dir of GameShell's "world"; "base directory" = parent of "root directory")

You can easily "unprotect" the base directory with gsh unprotect, but it should probably be used only during development. (Note that when starting in debug mode, the base directory is not protected by default, and it is unprotected for one specific mission that may require accessing GameShell from an outside file manager.)

One thing that would mitigate the problem you describe is checking $PWD in PROMPT_COMMAND and print a message describing how to go back to the root directory.
What do you think?

from gameshell.

daviewales avatar daviewales commented on August 25, 2024

Thanks for the detailed response. 😄

I think there should definitely be some help to direct users back to the $HOME directory.
Printing a message as you've described would definitely help!
Perhaps something like:

"You've navigated outside of GameShell. Type cd to return to the GameShell home directory."

from gameshell.

daviewales avatar daviewales commented on August 25, 2024

Thank you!

from gameshell.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.