When I use a terminal or zsh I can't run commands, And this is what appears: /dev/fd/14:18: command not found: compdef - terminal

When I use a terminal or zsh I can't run commands, And this is what appears:
# /dev/fd/14:18: command not found: compdef #
Does anyone know how to reset the terminal to normal mode?
I tried to solve it and the only thing that got my terminal back to normal is the elapsed time, but the problem is not solved because this line keeps repeating again, and then I'm stuck

I understood what the problem was, I just installed the latest version of Node js, and that's why I had this problem, when I reverted to a previous version it solved the problem

I had a similar situation today, and after looking up the information, it was the reason why I installed Angular

Related

command not found after reinstalling git bash with "Windows default console window"

Before re-installing Git Bash, I was using "MinTTY as default terminal emulator". I just wanted my git bash to be colorful! Reinstall, follow this stackoverflow answer. Then when I use the same Git Bash apparently my common commands which is already installed before like:
nvm
node
npm
code
Is all gone! How do I get all of my command list back? I have python running thought, because I wrote in .bashrc alias python= winpty python. Are there any way to add those commands without adding them one by one through PATH environment variables? Or do I have to keep adding my list in .bashrc?
Thank you!
thank you for the attention.
Apparently, I was using the first CLI that is offered by the installation launcher after the installation is done. With the same CLI, I was so confused why does this CLI doesn't run my usual commands. However, turns out it can be solved by simply closing and opening a new CLI. Then everything went fine.
I sure felt so silly. Should've tried restarting it from the beginning.

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

iTerm and terminal fail immediately on Mac - 'BrokenPipe'

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

.local/share/autojump/autojump_errors: No such file or directory

I've got autojump installed but, after upgrading homebrew, every time I issue a shell command (e.g. ls) I now get this:
-bash: /Users/snowcrash/.local/share/autojump/autojump_errors: No such file or directory
Any ideas on how to fix this?
I believe this used to be an issue but according to this GitHub Issue it should be fixed.
Otherwise I recommend you quit your current terminal application and restart. It took that for mine to stop throwing the error after I upgraded.

Resources