4

As I exit out of zsh on the terminal on MacOs, it gives me a message:

logout

Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Process completed]

This however doesn't close the Terminal window.

This might be related to the another problem I've been having. I used chsh -s /bin/bash to make bash my main terminal shell. This however doesn't work - terminal still opens with zsh.

Wieland
  • 6,353
  • 3
  • 28
  • 31
turtlehouse
  • 43
  • 1
  • 4
  • Have you checked the /etc/passwd file for your user? It will show the shell you are using. Just replace /bin/zsh with /bin/bash. – LincolnP Nov 01 '21 at 00:36
  • I have no experience with MacOS at all (and therefore I'm not posting this as an answer), but I can imagine two general scenarios: (1) your terminal emulator may be configured to run `zsh` and not to close when the main program (i.e. `zsh`) exits; (2) you use some kind of shortcut that runs `zsh` in terminal emulator and configures the terminal emulator not to close. – Kamil Maciorowski Nov 01 '21 at 00:51
  • @LincolnP I do have /bin/bash. – turtlehouse Nov 01 '21 at 02:38
  • @KamilMaciorowski (1) that is very weird to me; (2) any way that you suggest for me to check that? i don't recall doing that ever. – turtlehouse Nov 01 '21 at 02:40

1 Answers1

4

This can be configured in the settings of Terminal.app:

To change these preferences in the Terminal app on your Mac, choose Terminal > Preferences, click Profiles, select a profile, then click Shell.

(https://support.apple.com/en-gb/guide/terminal/trmlshll/2.11/mac/11.0)

The setting you're looking for is called

When the shell exits

It sounds like it is set to either of

  • Close if the shell exited cleanly: The Terminal window stays open if there was an error upon exit; otherwise, it closes.
  • Don’t close the window: The Terminal window stays open upon exit.

The third option is

  • Close the window: The Terminal window closes upon exit.
Wieland
  • 6,353
  • 3
  • 28
  • 31