Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rethink the prompt #576

Open
allanday opened this issue Oct 13, 2020 · 4 comments
Open

Rethink the prompt #576

allanday opened this issue Oct 13, 2020 · 4 comments
Labels
1. Bug Something isn't working 2. CLI Issue is related to the command line interface 2. Container Realm The issue is related to what happens inside of a toolbox container 2. Design Design discussion Project Pickle 🥒 UX refinement initiative
Milestone

Comments

@allanday
Copy link
Collaborator

allanday commented Oct 13, 2020

One of the main challenges using toolbox is knowing which environment your prompt is in. Our current approach to this:

image

Various issues here:

  • The hexagon:
    • It doesn't look great: the colour isn't the best, and it's squashed in before the prompt.
    • Why a hexagon? There's no obvious connection to toolboxes. Semantically it's odd.
    • It isn't able to differentiate between different toolboxes.
  • The prompt just says toolbox. Like the hexagon, it doesn't differentiate between toolboxes.

This is a somewhat complicated topic, since we have to think about the overall structure of the prompt. We also maybe need to think about the various tools that exist for doing fancy prompts.

@allanday allanday added 1. Bug Something isn't working 2. Design Design discussion labels Oct 13, 2020
@allanday
Copy link
Collaborator Author

I was recently playing around with some ideas for this, and came up with:

image

The initial "f33" with coloured background is supposed to indicate the current toolbox. This would require that we ensure that there's a short name for each toolbox. We could also assign a different colour to each toolbox, to use as the background for this short ID.

The format for the rest of the prompt was: <current project folder> <git branch> <current dir>, but I suspect that that's out of scope for this ticket.

@tpopela
Copy link
Collaborator

tpopela commented Oct 13, 2020

I will link containers/podman#6192 here as this could help us in improving the prompt experience.

@rrichardson
Copy link

rrichardson commented Oct 22, 2020

This is not a universal solution, but I added these three lines to my starship config:

[env_var]
variable = "containers"
format = "[🔧](fg:177)"

And now my prompt has a wrench when I'm in a podman shell (and have access to my home dir)

(once containers/podman#6192 is completed, the prompt can be a lot more precise)

@HarryMichal HarryMichal added 2. CLI Issue is related to the command line interface 2. Container Realm The issue is related to what happens inside of a toolbox container labels Feb 18, 2021
@runiq
Copy link

runiq commented Nov 29, 2021

Now that containers/podman#6192 is done, this is what I use with Starship to have the current toolbox name (and the  ) in my prompt:

[custom.toolbox]
shell = [ "sh", "--norc" ]
command = """ grep -Po 'name="\\K[^"]+' /run/.containerenv """
when = "test -f /run/.containerenv"
format = "[ $output]($style) "
style = "#808080"

@HarryMichal HarryMichal added this to the Release 0.2.0 milestone Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. Bug Something isn't working 2. CLI Issue is related to the command line interface 2. Container Realm The issue is related to what happens inside of a toolbox container 2. Design Design discussion Project Pickle 🥒 UX refinement initiative
Development

No branches or pull requests

5 participants