iTerm and terminal fail immediately on Mac - 'BrokenPipe' - bash

This happened right after I tried to install pyenv and then virtualenvrapper.
As soon as I open iTerminal I get a "Broken Pipe" message and macOS terminal also shuts down immediately.
I have been trying to debug my .bash_profile but uncommenting one after another but without avail
I tried updating homebrew and bash but no change (using a previously open iterm session)
I restarted my computer with the unfortunate effect that I can't access iterm or terminal now (all old sessions closed)
I am quite at loss here now, I have no clue why this happened and how to go about fixing it without having a functioning terminal.
I'd appreciate any advice or pointers.

Following #user1934428 advice I added set -x to all the bash startup files, unfortunately was still met with the same problem. Changing the startup shell in the terminal preferences didn't work.
Thankfully when using emacs ansi-term I was able to get some information/feedback message:
The default interactive shell is now zsh.
To update your account to use zsh, please run chsh -s /bin/zsh.
For more details, please visit https://support.apple.com/kb/HT208050.
Following the link I found that default shell has been changed to zsh Catalina. So I went and followed the instructions on the support page and changed the default shell back to bash, which fixed the problem. I am not quite sure why this problem occurred initially since the Broken Pipe Error appeared before I updated to Catalina.
Anyways changing the default shell back to bash shell fixed everything

Related

Trying to run a Unix-exec file via MacOS Terminal results in "zsh: exec format error"

I'm on MacOS BigSur 11.4. I'm trying to run an executable file to start a Minecraft server from a folder of set up files associated with a Minecraft/Python coding book (https://nostarch.com/programwithminecraft).
My order of operations has been. 1) I moved to the file's path via cd/, 2) set the file's executable bit via: chmod +x ./NAME_OF_THE_FILE, and 3) try running the following command to execute the file: ./NAME_OF_THE_FILE
Another post advised that once I run those commands, going forward I just need to run the third command while in the files path. However, no matter how many things I try to I keep getting a "zsh: exec format error."
I suspect this has something to do with the book's publication being in 2015 when the current version of MacOS was Mountain Lion, which was before they switched from bash to zsh with all releases successive to Catalina. This would suggest I'm just formatting something wrong in a way that conflicts with the zsh syntax, but I can't figure it out. I'm searching around zsh format error related posts and they all discuss actions and conflicts that seem only tangentially related to my issue. Any help appreciated.
Thank you

Git Bash in windows won´t start

I´m really new using Git Bash so sorry in advance if my description is a little rough.
I was trying to use python inside Git Bash for windows so i followed this instructions: https://www.youtube.com/watch?v=M33oOq-c60s&t=2s&ab_channel=chinamatt
When I closed and try to re-open Git,it loaded for a few seconds and closed, without any error message,
Now I can´t make it load even unistalling and re- installing it, the only thing I notice is that at the top of the window it says usr/bin/bash --login i..
I guess it had to do with the '. ${HOME}/.bash_profile' ~ /.bashrc command, but I have no idea since
I´ve had never used {HOME} command before.
First, make sure your git bash works again, by removing any ~/.bahs_profile and ~/.bashrc
Second, consider, if you are on the latest Windows 10, to use WSL2, in which you will be able to install/use Python in a familiar Linux environment, as opposed to Git limited mingw/bash.

Vim completely broken, can not use

Upon opening vim in my terminal, I receive this error
Error detected while processing CursorMoved Autocommands for "*"..function <SNR>
6_Highlight_Matching_Pair:
It repeats multiple times upon launch vim, then I can access vim however any movement (lkjh) causes the error to occur more.
I have deleted my .vimrc, updated my vim via brew. Neither has had any affect, vim is my go to IDE because I have it set up with plug ins in a efficient way that I prefer for programming.
Can someone please help me figure out what is occurring? Also, possibly important info I recently ran a brew update to update everything in my package manager.
Inside vim you can try using :scriptnames to get the list of loaded scripts and determine what files could be causing the issue. You can also check if vim can load without loading any additional scripts by launching with vim -u NONE.

Terminal stalling on every command due to Xcodebuild

I just updated Xcode to 11.4 and suddenly my terminal (iTerm 3.3.9) is now very slow. Typing a command works fine, but upon pressing enter I often wait 3-4 seconds to perform a simple task (cd, git add, etc).
When I look at the status bar I notice that xcodebuild is running during the time while I am waiting. I'm assuming that the new Xcode update did something that makes this process longer or needs a setting updated somewhere.
I have already tried sudo xcodebuild -license accept and that did not fix the problem. Additionally, there is no xcodebuild call inside of my .zshrc file.
Where can I find out what the terminal is trying to do with Xcodebuild? I suspect identifying the command being run is the first step towards determining how to fix it.
FWIW, this problem also happens in the Apple-provided terminal, so I don't think it's iTerm specific.
I've found many answers but at the first start the console is still very slow (15s).
At end looking around I found out that somehow it's nvm that needs xcodebuild.
The slowdown was fixed changing the nvm default to system
nvm alias default system

Basic terminal commands not working after trying to install Composer

My mac terminal is completely dysfunctional! Every time I open terminal I get this message:
-bash: export: `/Applications/MAMP/bin/php/php5.5.10/bin/:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin': not a valid identifier
The problem came about a while ago, I believe I was attempting to install composer to work with MAMP.
Today I started a beginner tutorial on how to use the Terminal and almost every command does not work such as the basic mkdir , ls , and touch (to make folder, list items, and make a file respectively), (screenshot attached).
I have already tried deleting the ~/Library/Preferences/com.apple.Terminal.plist file. Your help is greatly appreciated.
I am working with Mac OS X 10.10.2
screenshot of terminal after making basic commands
It looks like you have an error in your .bash_profile or other startup script. Open it on terminal using vi ~/.bash_profile or some other editor of your choice and comment out that line, then type source .bash_profile to reload it.

Resources