Restart terminal without closing on MacOS

Just type in the command:

exec bash -l

I guess that should do it.

For zsh,

exec zsh -l

This is needed because every shell on macOS by default is a login shell.

Justing writing exec bash would replace the current shell with a non-login shell which is not the same effect as closing and re-opening the terminal.

exec would make new bash -l process replace the current shell. If exec is not used, bash -l would spawn a new shell over the current shell incrementing the $SHLVL.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)