derickson2402 / Dockerized-CAEN

Containerized dev environment that plugs into VS Code so you can test on CAEN without the hassle
GNU General Public License v3.0
5 stars 1 forks source link

Add custom command prompt inside of container #29

Closed derickson2402 closed 2 years ago

derickson2402 commented 2 years ago

It would be cool to add a custom bash prompt in the container, possibly even with emoji support...

derickson2402 commented 2 years ago

What if you could set a config option to pass your normal prompt into the container... we would just need to check for their PS1 env variable and call ```CAEN_ARGS="-e PS1='${PS1}'". Only problem is if they are using zsh on host, the format is different, so it won't work. And installing zsh into container is not necessarily ideal

derickson2402 commented 2 years ago

093b36d has a fix, but it only works if you launch as root. Notably though starting as root, creating a user, and su user will also work, seemingly due to the created user having a home folder. Not sure a good way around this other than maybe an entrypoint script which can create the user instead of docker.

derickson2402 commented 2 years ago

Fixed issue by using env variables defined within the Docker manifest, implemented on dev branch

derickson2402 commented 2 years ago

For some reason, custom prompt doesn't work from inside the dev container, the container from the docker end looks to have PS1 defined but the shell itself doesn't show that it's set

derickson2402 commented 2 years ago

Fixed this by adding the env var to the devcontainer.json file. On dev branch for testing.