Search code examples
powershellssh

Using powershell ssh doesn't show terminal colors


I was using windows10 powershell to access to my raspberry pi which is raspbian system. When I use only ssh user_name@raspberrypi, I was able to see different colors for directories, executable files, etc.

But there was 1 time that I tried to use ssh -Y user_name@raspberrypi (because I want to see some pictures by evince but it turns out I didn't have X window on my Windows) then there was no color shown for different kind of files.

I tried to not use -Y but the colors didn't came back, also I closed the powershell window and reopen it, ssh user_name@raspberrypi still has no color for files.

I checked terminal colors on vnc viewer directly and there were colors. Why this happens and how can I see the colors again?

Update: I tried to access another PC by ssh, but I can see colors for different kinds of files! And I still can't see colors when I access my rasp pi, it's very wired... (again, if I access my pi via vnc viewer I can see colors on terminal directly)


Solution

  • This is solved to add:

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

    in my .bash_profile

    The situation is: At the first time there isn't a .bash_profile in my home directory, so when I use ssh the .bashrc is loaded every time.

    I don't remember well but maybe at some point I created the .bash_profile and added something, if I use ssh, this time the .bash_profile will be loaded instead of .bashrc (the color setting is in .bashrc and it was not loaded) so I have no color on terminal.