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

Force a prompt if PS1 is empty entering a container. #5647

Merged
merged 1 commit into from
Oct 22, 2020
Merged

Force a prompt if PS1 is empty entering a container. #5647

merged 1 commit into from
Oct 22, 2020

Conversation

dtrudg
Copy link
Contributor

@dtrudg dtrudg commented Oct 21, 2020

Description of the Pull Request (PR):

If a container without a .singularity.d is run then there is no
environment file to set a custom PS1.

If additionally singularity is called through a script, which will reset
PS1 to empty, then a confusing silent prompt will result.

In our action script force PS1 to a default if it is empty.

This results in the example given in #5340 producing a prompt as expected:

02:31 PM $ ./dosing exec centos7-sandbox /bin/bash
Singularity> 

This fixes or addresses the following GitHub issues:

Before submitting a PR, make sure you have done the following:

Attn: @singularity-maintainers

 - Fixes: #5340

If a container without a `.singularity.d` is run then there is no
environment file to set a custom `$PS1`.

If additionally singularity is called through a script, which will reset
`$PS1` to empty, then a confusing silent prompt will result.

In our action script force PS1 to a default if it is empty.
@dtrudg dtrudg added this to the 3.7.0 milestone Oct 21, 2020
@dtrudg dtrudg self-assigned this Oct 21, 2020
Copy link
Collaborator

@DrDaveD DrDaveD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it and it fixed the problem for me.

@cclerget cclerget merged commit 8f9a168 into apptainer:master Oct 22, 2020
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 this pull request may close these issues.

Default PS1 missing in 3.6.0 if run through a bash script and no .singularity.d in image
3 participants