Giter VIP home page Giter VIP logo

Comments (6)

gcurtis avatar gcurtis commented on May 18, 2024 1

I agree that controlling the prompt customization with an env var is the best bet. We could...

  • Check if DEVBOX_NO_PROMPT is set. If it is, don't change PS1 in the post-init hook.
  • Introduce a DEVBOX_PROMPT env var.
    • If left unset, we default to the current behavior of updating the prompt.
    • If set to empty, we leave the prompt alone.
    • If set to anything else, we change the prompt to its value.

I'm not sure if DEVBOX_PROMPT would be more convenient than having users add if [ -n "$DEVBOX_SHELL_ENABLED" ]; then export PS1=foo; fi to their shell rc.

from devbox.

gcurtis avatar gcurtis commented on May 18, 2024 1

Just wanted to give an update here on how we're planning to fix this for the next release.

Now that devbox supports setting shell hooks in devbox.json, we're going to remove the builtin logic that sets the prompt entirely. Instead, devbox init will generate a devbox.json that sets a prompt by default with something like:

{
  "shell": {
    "init_hook": "export PS1='(devbox)$ '"
  }
}

That way the prompt can be disabled by simply removing or changing the hook.

from devbox.

gcurtis avatar gcurtis commented on May 18, 2024 1

Yep! DEVBOX_SHELL_ENABLED will still be there.

from devbox.

Lagoja avatar Lagoja commented on May 18, 2024

Thanks for the feedback. Some ideas to address this:

  • Make it an option during installation ("Do you want Jetpack to add an indicator to your prompt?")

  • Provide users with a snippet that they can add to their shell profile

  • Add an Env variable that toggles off the default indicator (so developers can configure their own using the environment variable).

from devbox.

kmaris avatar kmaris commented on May 18, 2024

Personally, the third option seems best. If folks are running custom themes, chances are they're comfortable with environment tweaking (and perhaps the theme itself) to address toggling the behavior.

If you did the first option, would folks have to re-install to change the behavior? Across workstations? That could get tiring.

And the second option works but I think environment vars are more accessible and portable across shells and OS'es.

My 2 cents anyhow :) Thanks for considering this!

from devbox.

kmaris avatar kmaris commented on May 18, 2024

Sounds reasonable to me! Are you still planning to export DEVBOX_SHELL_ENABLED?

from devbox.

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.