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

command prompt in docker #540

Closed
KrisThielemans opened this issue May 18, 2021 · 2 comments · Fixed by #574
Closed

command prompt in docker #540

KrisThielemans opened this issue May 18, 2021 · 2 comments · Fixed by #574
Milestone

Comments

@KrisThielemans
Copy link
Member

Oh, one other point, the terminal from Jupyter has a horrible command prompt that appears after every command:

/bin/sh: 1: __git_ps1: not found
(base) sirf:\w$

Originally posted by @DANAJK in SyneRBI/SIRF-Exercises#22 (comment)

@KrisThielemans
Copy link
Member Author

that'll probably due to

curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh \
> ~/.git-prompt.sh
. ~/.git-prompt.sh

@DANAJK maybe you could try to remove the call to git-prompt from your ``docker, .bashrc

@KrisThielemans KrisThielemans added this to the v3.1 milestone May 20, 2021
@KrisThielemans KrisThielemans modified the milestones: v3.2, v3.1 Jun 3, 2021
@KrisThielemans
Copy link
Member Author

Trickier than expected...

It turns out to be because jupyter opens a shell with /bin/sh, which doesn't understand the fancy PS1 set in .bashrc.

export PS1='sirf:\w$(__git_ps1)\$ '

However, the .profile (correctly) doesn't read the .bashrc

if [ -n "$BASH_VERSION" ]; then
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi

Nevertheless, the jupyter terminal does have PS1 (and various SIRF variables which are not set at all)!

My guess is that the jupyter terminal inherits the env from jupyter which was started from bash.

Options for fixing:

KrisThielemans added a commit to KrisThielemans/SIRF-SuperBuild that referenced this issue Jun 14, 2021
addresses SyneRBI#540 (by disabling the git-prompt feature which only works in bash)
@KrisThielemans KrisThielemans linked a pull request Jun 15, 2021 that will close this issue
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.

1 participant