.bashrc being loaded instead of .zshrc when using tty or ssh

When I log into my computer using ssh or use a tty by typing Ctrl+Alt+F3 or some other combination, after logging in, I get a weird message. The intriguing part is that it seams to try to read .bashrc instead of .zshrc, even though my $SHELL variable says I’m using zsh.

Here’s what’s being output:

Last login: Sat Oct 29 23:58:47 2022
/home/jacom/.bashrc:type:64: bad option: -P
/home/jacom/.bashrc:105: command not found: shopt
/home/jacom/.bashrc:107: command not found: shopt
/home/jacom/.bashrc:112: command not found: shopt
Color escapes are \e[${value};...;${value}m
Values 30..37 are foreground colors
Values 40..47 are background colors
Value  1 gives a  bold-faced look

  \e[30m    TEXT BOLD  \e[30;41m TEXT BOLD  \e[30;42m TEXT BOLD  \e[30;43m TEXT BOLD  \e[30;44m TEXT BOLD  \e[30;45m TEXT BOLD  \e[30;46m TEXT BOLD  \e[30;47m TEXT BOLD

  \e[31m    TEXT BOLD  \e[31;41m TEXT BOLD  \e[31;42m TEXT BOLD  \e[31;43m TEXT BOLD  \e[31;44m TEXT BOLD  \e[31;45m TEXT BOLD  \e[31;46m TEXT BOLD  \e[31;47m TEXT BOLD

  \e[32m    TEXT BOLD  \e[32;41m TEXT BOLD  \e[32;42m TEXT BOLD  \e[32;43m TEXT BOLD  \e[32;44m TEXT BOLD  \e[32;45m TEXT BOLD  \e[32;46m TEXT BOLD  \e[32;47m TEXT BOLD

  \e[33m    TEXT BOLD  \e[33;41m TEXT BOLD  \e[33;42m TEXT BOLD  \e[33;43m TEXT BOLD  \e[33;44m TEXT BOLD  \e[33;45m TEXT BOLD  \e[33;46m TEXT BOLD  \e[33;47m TEXT BOLD

  \e[34m    TEXT BOLD  \e[34;41m TEXT BOLD  \e[34;42m TEXT BOLD  \e[34;43m TEXT BOLD  \e[34;44m TEXT BOLD  \e[34;45m TEXT BOLD  \e[34;46m TEXT BOLD  \e[34;47m TEXT BOLD

  \e[35m    TEXT BOLD  \e[35;41m TEXT BOLD  \e[35;42m TEXT BOLD  \e[35;43m TEXT BOLD  \e[35;44m TEXT BOLD  \e[35;45m TEXT BOLD  \e[35;46m TEXT BOLD  \e[35;47m TEXT BOLD

  \e[36m    TEXT BOLD  \e[36;41m TEXT BOLD  \e[36;42m TEXT BOLD  \e[36;43m TEXT BOLD  \e[36;44m TEXT BOLD  \e[36;45m TEXT BOLD  \e[36;46m TEXT BOLD  \e[36;47m TEXT BOLD

  (default) TEXT BOLD  \e[41m    TEXT BOLD  \e[42m    TEXT BOLD  \e[43m    TEXT BOLD  \e[44m    TEXT BOLD  \e[45m    TEXT BOLD  \e[46m    TEXT BOLD  \e[47m    TEXT BOLD

I made sure to replace both .bashrc and .zshrc with the ones found in /etc/skel, but it made no difference.

EDIT:
I have also done chsh -s /bin/zsh, but it had no effect.
This doesn’t happen on my laptop, which is also running Manjaro, even though I don’t think I changed anything on my Desktop machine that would cause this.

That only can mean that somehow your .zshrc script is calling the .bashrc script. You’ll have to find out how.

Maybe something like this can help you find out where is .bashrc called:
grep "\.bashrc" ~/.* 2> /dev/null

1 Like

zsh is only used as the default shell for terminal sessions in the graphical environments — i.e. Plasma, GNOME or XFCE; the community editions may differ in that — while for everything else, the system uses bash as the default shell.

1 Like

I ran that command and found the my .zprofile file was calling the .bashrc file.
I have absolutely no clue how it happened, but strangely enough, it’s annotated like it is a .bash_profile file. It even has the

#
# ~/.bash_profile
#

header thingy.
Anyways, commenting out [[ -f ~/.bashrc ]] && . ~/.bashrc did the trick.

EDIT: I believe this happened as a result of JetBrains Toolbox doing something strange. The only line in my .zprofile file other than the one calling .bashrc is a line adding the JetBrains Toolbox scripts to my path.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.