How to fix Mac terminal being incredibly slow after brew install tmux - macos

I've installed tmux using brew ( arch -x86_64 brew install tmux ) on M1 Mac and since then my terminal is super slow. on lunch, after running commands and it's just incredibly slow.
I tried deleting the package using
brew uninstall pkg
it didn't work. I tried using the following commands as well.
brew remove pkg
brew rmtree tmux
I get "Error: tmux is not currently installed" since I've already uninstalled it..
and when using
sudo find / -name "*tmux*"
I still get many files including tmux.
GIFs showing the situation
any ideas/help on how to solve this?

Ok I have fixed it.
although I didn't know exactly what was the problem but it was something related to oh-my-zsh and to be more specific it was with the current oh-my-zsh theme powerlevel9k after installing tmux.
here is the steps I toke: I tried to change my shell to bin/bash it worked great. Tried a couple more shells and all worked great except zsh. then I tried to change the .oh-my-zsh directory name just for testing purposes and opened zsh, it worked great but of course without oh-my-zsh.
so I went to .zshrc and commented this line.
#ZSH_THEME="powerlevel9k/powerlevel9k"
obviously installing tmux messed things up so I'll need to reinstall the theme or oh-my-zsh all over again.

Related

Mas OS Big Sur update - Python3 / conda / pip not found

Sorry if this is a stupid question. I use python/jupyter a lot and it's stopped working after updating from Mac OS High Sierra to Big Sur. I'm trying to figure out why, but I'm not great with command line stuff.
The problem. When I try python3, pip -v, conda, etc. it says "command not found". python still seems to run, but it's 2.7 and I know I had 3 (I probably had a few versions from untidy file systems). I want to avoid reinstalling all my packages and things again, because I know it's still there and I've done this a few times already.
Some clues. I know this OS upgrade moves me from bash to zsh. I've tried just switching back to bash with chsh -s /bin/zsh but it still says command not found. I also noticed the OS update creates a Mac HD (below System/Volumes) within my Mac HD, and in that second one seems to be still all my python3/conda/pip/etc. folders. Not sure if/how this matters. Or if this is just a path issue.
I just want to get Jupyter running again on my Mac without reinstalling all my myriad packages from square one. Any help appreciated!
After extreme toil and research, I finally found something that worked for me.
Find the location of your Anaconda3. For me it was in ~/opt/anaconda3
Open terminal and type source <location of anaconda3>/bin/activate and then in the next line, write conda init zsh
Close your terminal and open it again. You should see a prefix (base) when you open it again.
All in all, for me it was
rko3 ~ % source opt/anaconda3/bin/activate
rko3 ~ % conda init zsh
Let me know if this works for you!
PS. You may be tempted to change $PATH variables. Anaconda advises against that. Use this reference instead that suggests the above. https://docs.anaconda.com/anaconda/install/mac-os/
I've just resolved this exact issue on my machine after upgrading to Big Sur from Mojave.
The issue: MacOS, as of Catalina, no longer lets you use the system root folder. Anaconda used to install in this folder. After upgrading from Mojave to Big Sur, you'll likely find your anaconda3 folder, including all your environments and packages, located here: /System/Volumes/Data/anaconda3.
Here is what to do to fix it:
Open Terminal
Move the anaconda3 folder:
sudo mv /System/Volumes/Data/anaconda3 ~/
Download Anaconda's Conda Prefix Replacement (crp) tool:
curl -L https://repo.anaconda.com/pkgs/misc/cpr-exec/cpr-0.1.1-osx-64.exe -o cpr && chmod +x cpr
Run the CRP tool (this will take a few minutes):
./cpr rehome ~/anaconda3/
Source anacoda3
source ~/anaconda3/bin/activate
Initiate conda
conda init
Quit Terminal and open it again.
Edit: Someone didn't like that I ended this answer with "That's it! Enjoy". In the scenario described, the steps above were indeed all it took to resolve the issue. If you're experiencing the same issue, I hope this helps resolve it, so you can get back to enjoying your updated OS.
Seems like your environement is not activated. Zsh sources ~/.zshrc while bash sources ~/.bashrc.
You can copy lines related to conda from your ~/.bashrc to your ~/.zshrc.
AF
Open the Anaconda navigator and click on the Environments section. There you will see the base (root) and a green triangle next to it.
Click on the triangle and select Open Terminal.
Now, in the terminal you will be already in the necessary directory for anaconda and you can then update any packages.
For example, just by writing conda update --all you can update all packages available for updates.

Iterm window closes upon start after having ran brew update && brew upgrade (using zsh on Mac)

I have updated brew and now iTerm2 window closes immediately. Does anyone know how to fix this?
The commands I ran were brew update and brew upgrade
I also use ZSH as my default shell. I have read now that upgrading brew and not updating zsh
can cause problems but I don't know how to get back now.
I reposted this question on AskDifferent since this is not the correct place for this.
https://apple.stackexchange.com/questions/392686/macos-brew-upgrade-causes-server-version-to-old-for-client-broken-pipe-zsh

ZSH: Command not found - after update macOS to 10.15.1

Yesterday I was using all my installed packages without any problem such as mysql, composer, php, brew and co...
However, today I started my MacBook and typed mysql and I got: zsh: command not found: mysql. Not even brew is working anymore and I don't know why.. this is my .zshrc config file and I don't know why it isn't working.
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:/usr/local/bin:~/.composer/vendor/bin:$PATH
Any ideas how to fix this?
Yuck, how did that happen? Try this:
PATH=/bin:/usr/bin:/usr/local/bin:$PATH
export PATH
Whether this works is going to depend on where you have been installing user executables. If you're using homebrew, I would expect it to be /usr/local/bin but perhaps it is something different in your case? You might want to try putting /usr/local/bin first so things installed by homebrew get picked up before the defaults in /usr/bin and /bin (this is what I do, and I'm still alive to talk about it...)
You could also change your default shell back to Bash:
brew install bash
echo '/usr/local/bin/bash' >> /etc/shells
chsh
You might need to use sudo on line 2.

How do I get autochdir to work on a Mac when running Vim from the terminal?

In MacVim autochdir works without a problem. However, lately I've been running iTerm2 (full screen with split) for coding and the lack of autochdir is really bothering me. Any solutions? Thanks.
What do you mean by "the lack of autochdir"? It works fine both in CLI and in GUI.
If you have set autochdir in your ~/.vimrc this feature will work the same way whether you are in MacVim or iTerm2 or Terminal or whatever.
But I suspect you are changing dirs in an iTerm2 split and expecting Vim to somehow learn about that change and change its pwd accordingly. Am I right? "Unfortunately" Vim doesn't know about the second iTerm2 split and can't react to your cd there.
In the terminal:
> which vim
If it says /usr/bin/vim, you're using the mac base installation. This is an old version of vim and doesn't support autochdir. You'll need a newer version.
Check if you have another installation of vim by running:
> /usr/local/bin/vim
If so, add /usr/local/bin to your $PATH before /usr/bin
If not, install it:
> brew install vim

Run Octave within the same Terminal session

I set an alias in my .bash_profile for Octave
alias octave="open /Applications/Octave.app"
It opens in a new Terminal window. How do I run Octave within the same Terminal session like Python does?
Found it:
alias octave = "/Application/Octave.app/Contents/Resources/bin/octave"
Your mileage may vary, but I just installed Octave via homebrew
$ brew install homebrew
...and it actually worked. It failed once, and I had to manually brew install gfortran but then everything came together nicely.
I had tried this a year ago and it was very painful and I ended up using the bundled .app version like you (and made an alias exactly like the one you came up with), but now installing from source seems to have worked great. Plus, it gives you more options for plotting besides gnuplot.

Resources