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

Bash console prompt change after installing Anaconda. #2213

Closed
MaximoTrinidad opened this issue Jun 13, 2017 · 6 comments
Closed

Bash console prompt change after installing Anaconda. #2213

MaximoTrinidad opened this issue Jun 13, 2017 · 6 comments

Comments

@MaximoTrinidad
Copy link

MaximoTrinidad commented Jun 13, 2017

This bug-tracker is monitored by developers and other technical types. We like detail! So please use this form and tell us, concisely but precisely, what's up. Please fill out ALL THE FIELDS!

If you have a feature request, please post to the UserVoice. If you're reporting a BSOD, don't post here! Instead, e-mail "secure@microsoft.com", and if possible attach the minidump from "C:\Windows\minidump".

Problem

I wonder if this matters? I'm having issues with the prompt after I installed Anaconda.
Although, everything seems to be working but I don't know how to fix it yet.

  • Your Windows build number: (Type ver at a Windows Command Prompt)
    C:\Users\mtrinidad>ver

Microsoft Windows [Version 10.0.16215.1000]

What you're doing and what's happening: (Copy&paste specific commands and their output, or include screen shots)

  1. Open Bash Console.
  2. The prompt is not in color, and is all white:
    maxt@MTrinidadLT2:~$
  3. To restore prompt color (green) I execute:
    maxt@MTrinidadLT2:~$ source ~/.bashrc

What's wrong / what should be happening instead:

Bash Console prompt starts all white.

(See attached Image)
bashconsoleprompt_2017-06-13_9-07-29

Another thing... As soon I open Bash, before executing the 'source ~/.bashrc' command, I execute Python and comes up ver. 2.7. Then, when after I executed the command, it comes ver. 3.6.1.

(See attached image)
bashconsoleprompt1_2017-06-13_9-07-29

Workaround

To restore prompt color, execute command:
source ~/.bashrc

  • Strace of the failing command, if applicable: (If <cmd> is failing, then run strace -o strace.txt -ff <cmd>, and post the strace.txt output here)

See our contributing instructions for assistance.

@MaximoTrinidad MaximoTrinidad changed the title Bash console prompt change after loading Anacondadir. Bash console prompt change after loading Anaconda. Jun 13, 2017
@MaximoTrinidad MaximoTrinidad changed the title Bash console prompt change after loading Anaconda. Bash console prompt change after installing Anaconda. Jun 13, 2017
@0xbadfca11
Copy link

Does ~/.bash_profile or ~/.bash_login exist?
Change in Insider Preview, bash loading startup files has changed. (But, if these files that do not exist by default do not exist, will look like the same loading behavior.)
.bashrc file didn't load when start bash in windows #2067
Add "Run as login shell" option for Bash. #816 (comment)

@MaximoTrinidad
Copy link
Author

Thanks @0xbadfca11,

I've been rebuild (cleanup/reinstall) Windows Bash and, it hasn't failed, every time I completed the Anaconda installation, then ended up with the same situation.

So, I don't install Anaconda then everything is fine. The only thing (I think) Anaconda does is to add the to the PATH its folder location. I just don't understand how this changes the prompt behavior (??).

So, it is just annoying, to every time execute the 'source ~/.bashrc' command.

:)

@sunjoong
Copy link

So, it is just annoying, to every time execute the 'source ~/.bashrc' command.

@MaximoTrinidad - Default(?) ~/.profile might have source ~/.bashrc command like . ~/.bashrc below;

root@SUNJOONG-DESKTOP:~# cat ~/.profile
# ~/.profile: executed by Bourne-compatible login shells.

if [ "$BASH" ]; then
  if [ -f ~/.bashrc ]; then
    . ~/.bashrc
  fi
fi

mesg n || true
root@SUNJOONG-DESKTOP:~#

If you have ~/.bash_profile, you could insert that command into that file. That's why @0xbadfca11 asked the question, "Does ~/.bash_profile or ~/.bash_login exist?", I think.

@MaximoTrinidad
Copy link
Author

@sunjoong,

Hum! I got both .bash_profile and .profile but not .bash_login. I have to admit I didn't know of the ~/.profile or the ~/.bash_login files.

~/.bash_profile -> I think I created this one I added the path:

maxt@MTrinidadLT2:~$ cat ~/.bash_profile
export PATH="/opt/mssql-tools/bin:$PATH"

~/.profile -> This one already existed:

maxt@MTrinidadLT2:~$ cat ~/.profile
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
        . "$HOME/.bashrc"
    fi
fi

# set PATH so it includes user's private bin directories
PATH="$HOME/bin:$HOME/.local/bin:$PATH"

I know I just could add the command:

source ~/.bashrc

I'm just puzzle in how this happened. I have replicated this behavior in all on my demo Windows 10 VM's just after loading Anaconda Package. But, in Ubuntu full OS, it's fine.

There's always a possibility that is something to do with the shell itself as they still working on it.

:)

@MaximoTrinidad
Copy link
Author

MaximoTrinidad commented Jun 14, 2017

@sunjoong,

Solved this issue!! I cause my own problem, and your hint pointing me to these files helped.
I just needed to remove/delete the ~/.bash_profile, which I created, then I got the prompt behavior back to normal.

I'm going to closed this incident!

Greatly Appreciated,
Max

@MaximoTrinidad
Copy link
Author

@sunjoong, Thanks for the hint!!
:)

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

No branches or pull requests

3 participants