How to change the default prompt in fedora toolbox?

Hi!

I use a couple of containers every days and sometimes I forgot in which container I’m logged on. What is a easy why to set a default prompt that when I enter in a container with toolbox shows me the name of container?
For example, I have a container created with name dev-go, so it will be great if I could a prompt format like this:
⬢[masch@toolbox-dev-go ~]$

Thanks!

Last that I checked, I don’t think toolbox exposes the container name inside the container in any way. There was some discussion about doing that though: Offer a better way to visually distinguish between containers · Issue #98 · containers/toolbox · GitHub

If you want to do something a little hacky, you can store a file in each container that gets read into your prompt.

1 Like

Thanks for the tip!
I followed the issue that you suggest me and I’ve applied the next modification on my local toolbox script and It works!!

https://github.com/containers/toolbox/pull/383

Also I applied the same fix on the new toolbox migration written on Golang and it doesn’t work.
When I enter on I get I get the following error:

[conmon:d]: failed to write to /proc/self/oom_score_adj: Permission denied

DEBU[0000] Received: -1                                 
DEBU[0000] Cleaning up container bc62c05c07e87829c79b41aa69332ee3564fcbfa54c3953fdf138acea76be893 
DEBU[0000] Network is already cleaned up, skipping...   
DEBU[0000] unmounted container "bc62c05c07e87829c79b41aa69332ee3564fcbfa54c3953fdf138acea76be893" 
Error: unable to start container "bc62c05c07e87829c79b41aa69332ee3564fcbfa54c3953fdf138acea76be893": error stat'ing file `/tmp/go-build636086179/b001/exe/toolbox`: No such file or directory: OCI runtime command not found error

I don’t know how does it work on the toolbox script version and it doesn’t on the Golang version.