Which shell am I using?

Which shell am I using on my mac (Sonoma, OSX 14.5)? [1]

TEST #1
> echo $SHELL
/bin/zsh

TEST #2
> ps $o
  PID TTY           TIME CMD
 7487 ttys000    0:00.08 -zsh

TEST #3
Terminal.app > Settings > General
Shells open with [2]
[x] Default login shell
/bin/zsh

RESULT
We have zsh

Where is the configuration file for zsh? [3]

~/.zshrc

Content

export CLICOLOR=1
alias ls="ls -G"
alias ll="ls -lG"

# -------------------------------------------------------------------
# THIS IS: The main configuration file for my shell
# -------------------------------------------------------------------
# https://stackoverflow.com/questions/10574684/where-to-place-path-variable-assertions-in-zsh/10583324#10583324
# -------------------------------------------------------------------


# -------------------------------------------------------------------
# Hmmm, there is .zprofile
# -------------------------------------------------------------------
# It holds some stuff
# -------------------------------------------------------------------
# emulate sh
# source ~/.profile
# emulate zsh
#
#
## Setting PATH for Python 3.12
## The original version is saved in .zprofile.pysave
#PATH="/Library/Frameworks/Python.framework/Versions/3.12/bin:${PATH}"
#export PATH
# -------------------------------------------------------------------


# -------------------------------------------------------------------
# What about MAMPs configuration stuff?!!
# -------------------------------------------------------------------
# It is written in .profile
# -------------------------------------------------------------------
# So, I should be fine, if I put my stuff, there
# -------------------------------------------------------------------
# export PATH="/Applications/MAMP/bin/php/php8.2.0/bin:${PATH}"
# alias php='/Applications/MAMP/bin/php/php8.2.0/bin/php -c "/Library/Application Support/appsolute/MAMP PRO/conf/php8.2.0.ini"'
# alias php-config='/Applications/MAMP/bin/php/php8.2.0/bin/php-config'
# alias phpdbg='/Applications/MAMP/bin/php/php8.2.0/bin/phpdbg'
# alias phpize='/Applications/MAMP/bin/php/php8.2.0/bin/phpize'
# alias pear='/Applications/MAMP/bin/php/php8.2.0/bin/pear'
# alias peardev='/Applications/MAMP/bin/php/php8.2.0/bin/peardev'
# alias pecl='/Applications/MAMP/bin/php/php8.2.0/bin/pecl'

Other relevant config files

.zprofile (sources ~/.profile)

emulate sh
source ~/.profile
emulate zsh


# Setting PATH for Python 3.12
# The original version is saved in .zprofile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.12/bin:${PATH}"
export PATH

.profile


## Setting PATH for Python 3.12
## The original version is saved in .zprofile.pysave
#PATH="/Library/Frameworks/Python.framework/Versions/3.12/bin:${PATH}"
PATH="/Library/Frameworks/Python.framework/Versions/Current/bin:${PATH}"
export PATH

alias pip='/Library/Frameworks/Python.framework/Versions/Current/bin/pip3'
alias python='/Library/Frameworks/Python.framework/Versions/Current/bin/python3'


## MAMP Stuff
export PATH="/Applications/MAMP/bin/php/php8.2.0/bin:${PATH}"
alias php='/Applications/MAMP/bin/php/php8.2.0/bin/php -c "/Library/Application Support/appsolute/MAMP PRO/conf/php8.2.0.ini"'
alias php-config='/Applications/MAMP/bin/php/php8.2.0/bin/php-config'
alias phpdbg='/Applications/MAMP/bin/php/php8.2.0/bin/phpdbg'
alias phpize='/Applications/MAMP/bin/php/php8.2.0/bin/phpize'
alias pear='/Applications/MAMP/bin/php/php8.2.0/bin/pear'
alias peardev='/Applications/MAMP/bin/php/php8.2.0/bin/peardev'
alias pecl='/Applications/MAMP/bin/php/php8.2.0/bin/pecl'

Documentation about ZSH

Zsh is a shell designed for interactive use, although it is also a powerful scripting language. Many of the useful features of bash, ksh, and tcsh were incorporated into zsh; many original features were added. [4]

Zsh is an extended Bourne shell with many improvements, including some features of Bash, ksh, and tcsh. [5]

Why would Darwin/OSX make use of it?

In 2019, macOS Catalina adopted Zsh as the default login shell, replacing the GPLv2 licensed version of Bash. [5]

Apple hasn’t explained exactly why it’s making this change, but bash isn’t exactly a modern shell as it’s implemented in macOS, and a switch to something less aging makes a lot more sense for the company. Apple is stuck using version 3.2 of bash that has been licensed under GPLv2, as newer versions are licensed under GPLv3. Apple has kept clear of using GPLv3 packages in macOS as the license is generally more restrictive to companies like Apple that sign their own code and it includes explicit patent grants, too. [6]


References

[1] https://stackoverflow.com/questions/43417162/which-shell-i-am-using-in-mac

[2] https://stackoverflow.com/questions/43417162/which-shell-i-am-using-in-mac/43417476#43417476

[3] https://stackoverflow.com/questions/10574684/where-to-place-path-variable-assertions-in-zsh/10583324#10583324

[4] https://zsh.sourceforge.io/

[5] https://en.wikipedia.org/wiki/Z_shell

[6] https://www.theverge.com/2019/6/4/18651872/apple-macos-catalina-zsh-bash-shell-replacement-features

Bildquelle: Justin Dorfman/CC BY-SA 4.0

Mac