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

Enable color terminal in common cases #826

Merged
merged 2 commits into from
Mar 14, 2019
Merged

Conversation

parente
Copy link
Member

@parente parente commented Mar 13, 2019

Sets force_color_prompt=yes in /etc/skel/.bashrc to configure color prompts when adding a new NB_USER at image build time. Sets the same key/value in /etc/bash.bashrc to configure color prompts when host mounting a .bashrc file that respects the setting at runtime.

For #815

Copy link
Contributor

@javabrett javabrett left a comment

Choose a reason for hiding this comment

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

I suppose my main concern is that as commented in #815, this doesn't do anything for the Terminal plugin, and for an ad-hoc shell, the same should be able to be achieved by setting e.g. -e TERM=xterm-256color.

I guess it does no harm, unless we know of a situation where a terminal client doesn't support color.

# and in the default bash.bashrc for the case where the user home directory gets
# overridden.
RUN sed -i 's/^#force_color_prompt=yes/force_color_prompt=yes/' /etc/skel/.bashrc && \
sed -i 's/^#force_color_prompt=yes/force_color_prompt=yes/' /etc/bash.bashrc
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this second sed have any effect?

 docker run -it --rm ubuntu:bionic-20180526@sha256:c8c275751219dadad8fa56b3ac41ca6cb22219ff117ca98fe82b42f24e1ba64e grep -r force_color_prompt /etc
/etc/skel/.bashrc:#force_color_prompt=yes
/etc/skel/.bashrc:if [ -n "$force_color_prompt" ]; then
/etc/skel/.bashrc:unset color_prompt force_color_prompt

Copy link
Member Author

Choose a reason for hiding this comment

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

You are correct. I mistakenly thought the bash.bashrc also respected this flag. I've removed the second line and will update the PR description so that it correctly reflects what the PR enables.

@parente
Copy link
Member Author

parente commented Mar 13, 2019

@javabrett I found the terminal prompt in classic notebook and lab had color with these changes when running docker run -it jupyter/base-notebook.

@javabrett
Copy link
Contributor

:shipit:

@parente parente merged commit 022da74 into jupyter:master Mar 14, 2019
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.

2 participants