0

I just upgraded my Mac operating system to 10.15.1 (Catalina), and I'm now unable to interact with my terminal properly. When I open the Terminal application (or iTerm), it outputs the last attempted login time but does not then give me a prompt to enter commands.

I can see via Activity Monitor that the Terminal application is running a number of bash processes in the background that are possibly throwing errors, however I'm not sure how to decipher them. Here's a sample of what one such process is writing to /dev/stdout:

Sort by top of stack, same collapsed (when >= 5):
        __fork  (in libsystem_kernel.dylib)        1314
        read  (in libsystem_kernel.dylib)        909
        stat$INODE64  (in libsystem_kernel.dylib)        50
        szone_force_unlock  (in libsystem_malloc.dylib)        35
        __ioctl  (in libsystem_kernel.dylib)        34
        tiny_malloc_from_free_list  (in libsystem_malloc.dylib)        33
        _objc_atfork_parent  (in libobjc.A.dylib)        23
        tiny_free_list_add_ptr  (in libsystem_malloc.dylib)        23
        _sigtramp  (in libsystem_platform.dylib)        22
        __open  (in libsystem_kernel.dylib)        15
        _platform_memmove$VARIANT$Haswell  (in libsystem_platform.dylib)        12
        _malloc_fork_parent  (in libsystem_malloc.dylib)        9
        sigprocmask  (in libsystem_kernel.dylib)        9
        __pipe  (in libsystem_kernel.dylib)        7
        __wait4  (in libsystem_kernel.dylib)        7
        mach_msg_trap  (in libsystem_kernel.dylib)        7
        ???  (in bash)  load address 0x10cac2000 + 0x28ae1  [0x10caeaae1]        6
        close  (in libsystem_kernel.dylib)        6
        tiny_free_no_lock  (in libsystem_malloc.dylib)        6
        tiny_malloc_should_clear  (in libsystem_malloc.dylib)        6
        fork  (in libsystem_c.dylib)        5
        setpgid  (in libsystem_kernel.dylib)        5

Binary Images:
       0x10cac2000 -        0x10cb42ff7 +bash (118.40.2) <30A60B27-69AE-323A-AA7E-B8B648C54096> /bin/bash
       0x10d8e2000 -        0x10d972b5f  dyld (733.6) <DAFEA246-2F9A-3DCB-A37C-4246D4F92770> /usr/lib/dyld
    0x7fff61168000 -     0x7fff61169ff3  libSystem.B.dylib (1281) <1DD1BCD2-2C85-3B81-8CAF-224FB042F441> /usr/lib/libSystem.B.dylib
    0x7fff61446000 -     0x7fff61499fff  libc++.1.dylib (800.7) <1D42387D-206A-3F06-9B5F-705B83EAC295> /usr/lib/libc++.1.dylib
    0x7fff6149a000 -     0x7fff614aefff  libc++abi.dylib (800.7) <D89ABFBF-3754-35AB-BAEE-FBF14857F79B> /usr/lib/libc++abi.dylib
    0x7fff62939000 -     0x7fff62968ff7  libncurses.5.4.dylib (57) <7115BD9E-9A53-3538-BA7C-6D71E8C0F9F1> /usr/lib/libncurses.5.4.dylib
...

This problem is occurring when I have my Terminal preferences set to open shell with "Default login shell", which worked fine on my previous OS version, and with the startup command /bin/bash. Interestingly, I'm able to start up my terminal successfully when I change the shell startup command to /bin/sh, however I'm then unable to source my bash_profile in sessions started that way (when I type source ~/.bash_profile, the process hangs).

I tried renaming the file com.apple.Terminal.plist to com.apple.Terminal.OLD.plist, as per the suggestion here (that wasn't exactly my problem, but I was desperate, and it didn't work in any case).

I'm stuck—help much appreciated!

1
  • Hard to tell without knowing what's in your .bash_profile. My first recommendation would be to try run with /bin/sh, then run set -x; source ~/.bash_profile. This will make it print the commands (or their equivalent) as it executes them, so you can get some idea where it's getting stuck. Commented Dec 5, 2019 at 19:00

2 Answers 2

0

The problem ended up being that with Catalina, Apple has replaced bash with zsh as the default shell. (Great job letting everyone know)

Consequently, my shell scripts were hanging on the command builtin cd //.., because cd isn't a valid command in zsh. I ended up switching my shell from bash to zsh and porting over my .bash_profile settings to .zshrc. Thanks Apple, I'm really glad I spent the past 2.5 days of my life on this.

0

Using iTerm (iTerm2), go to "Preferences > Profiles > Shell" and change the startup command to /bin/bash (as of OsX 10.15.4), and start a shell.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .