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

"I have no name!" in prompt after logging in to container #366

Closed
lena-hinrichsen opened this issue May 19, 2023 · 2 comments · Fixed by #376
Closed

"I have no name!" in prompt after logging in to container #366

lena-hinrichsen opened this issue May 19, 2023 · 2 comments · Fixed by #376
Assignees

Comments

@lena-hinrichsen
Copy link
Member

lena-hinrichsen commented May 19, 2023

Logging in to a container in Docker, the prompt displays: I have no name!@ade9a4692fcd:/data$
(not affecting any functionality, just a confusing warning/placeholder here)

@kba suggested to fix this so it does not confuse users (cf. https://github.com/OCR-D/ocrd-website/pull/353/files#r1198902403)

@stweil
Copy link
Collaborator

stweil commented May 19, 2023

What prompt would you suggest? Prompts can be constructed from any text (for example a simple $ ), include the user's name (which is undefined here), the machine name (which is a random string here), the current working directory, but also date and time in any format and other things could be included.

Personally I'd omit the user and machine name because both are not relevant for a docker container and either use the very minimalistic prompt or one which shows the current working directory.

@kba
Copy link
Member

kba commented Jun 16, 2023

@bertsky proposed

We could, but it is helpful to see the user name in the prompt (esp. whether you are root). But since the default PS1 also uses \$ (which is $ for non-root and # for root), I guess we can simply drop \u – yes.

Since we do not set the hostname and the default hostname indeed appears random - I thought it was somehow related to the hash of the container but that does not appear to be the case, if anybody knows the algorithm for default hostname in Docker, please chime in - I think PS1='\w \$' would be best, i.e. current working directory and either $ (normal user) or # (root).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants