zsh: killed

I'm encountering an issue on macOS where I'm getting an error "zsh: killed". When I open Terminal the first I see is:

zsh: killed mkdir -m 700 -p "$SHELL_SESSION_DIR"

Whenever i try to run a command the same problem occurs:

Desktop % ls

zsh: killed ls

It happened after I was trying to install mongoDB

I've checked my system's resources and there doesn't seem to be any limitations or constraints. I also verified that I have sufficient disk space available.

Could someone please assist me in identifying the cause of this error and provide guidance on how to resolve it? I appreciate any help or suggestions. Thank you!

Posted on Jul 2, 2023 01:59 AM

Reply
14 replies

Jul 2, 2023 05:24 AM in response to Diana_Sereda

Diana,


I use just two Zsh shell related files in my $HOME directory, and that content in your .profile is unnecessary:


  1. ~/.zshrc
  2. ~/.zshenv


I put Zsh shell functions in the ~/.zshenv file.


The assumption is that you have already run the following command in the Terminal to formally switch to the Zsh shell:


/usr/bin/chsh -s /bin/zsh


and you have not edited your current Terminal Profile Shell tab, leaving Run command blank.


If Apple provides Zsh 5.9 as the standard shell in macOS, why is your .profile referencing eval Zsh shellenv content in homebrew? Unnecessary and potentially the assassin of your Zsh shell.


Since your .zshrc is empty, you will need at minimum a revisable PATH and PS1 set. The following is a HERE document that creates a ~/.zshrc file with both of those environment variables set. Just copy and paste the following into your Terminal and then press return afterward. I have adjusted the PATH to reference the installed home brew binaries on Apple Silicon hardware. That leading dot means your current directory.


<<"EOF" > ~/.zshrc
export PATH=".:opt/homebrew/bin:${PATH}"
PS1="%m: %~ %% "
EOF


One you have run this HERE document, do the following in your Terminal:


source ~/.zshrc


to make those PATH and PS1 changes effective in the current Terminal session. In practice, I do not attempt to run any commands from within the tilde dot files (e.g. your mkdir command).


Can't help with MongoDB.

Jul 2, 2023 05:30 AM in response to Diana_Sereda

Really? I'm very surprised by that.

I just went to my home folder, pressed Command-Shift-period, selected one of these files; pressed enter, renamed it, and pressed enter again.


You could try running a different shell, like bash, and renaming the file then.

You may change the shell in the Terminal settings, but it is better to just create a new "profile" that runs bash and keep zsh as the default.


I just duplicated the "Basic" profile, and changed the shell to be used in the new profile:


then Shell->New Window->Basic-bash


Since bash is the shell, no files like .zprofile, etc, will be read.

Jul 2, 2023 05:51 AM in response to Diana_Sereda

Diana_Sereda wrote:

eval "$(/opt/homebrew/bin/brew shellenv)"

Every.

Single.

Time.


You will have to figure out how to uninstall that infernal Homebrew software.


Then, once your command line environment is functional again, assuming it ever is, you can install some other database product. Normally in these cases I check the web site for the product and it has a normal installation method. It looks like Mongo itself is recommending Homebrew for its "Community Edition". I guess they want to drive more traffic to their paid versions.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

zsh: killed

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.