Toolbox: Rethink the prompt

Created on 13 Oct 2020  路  3Comments  路  Source: containers/toolbox

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.

1. Bug 2. CLI 2. Container Realm 2. Design Project Pickle 馃

Most helpful comment

I will link https://github.com/containers/podman/issues/6192 here as this could help us in improving the prompt experience.

All 3 comments

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.

I will link https://github.com/containers/podman/issues/6192 here as this could help us in improving the prompt experience.

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 https://github.com/containers/podman/issues/6192 is completed, the prompt can be a lot more precise)

Was this page helpful?
0 / 5 - 0 ratings