my terminal can't run on mac os 10.9? - macos

I used to install something from github,I stoped it and I can't open iterm-2 too
and I open my Bash ,it appeared
Command not found: /usr/local/bin/bash
[Could not create a new process and open a pseudo-tty.]
I can't input any words.
What should I change?

Google is full of others asking for help with this problem and half-baked solutions, including reboots (re-login should do it if env changed), reinstall (why?) etc.
Looks like a clone of I messed up my terminal environment on Mac OS X and was wondering how to fix it judging by inability to start bash from /usr/local/bin. System default should be in /bin or /usr/bin.
Your terminal (console or iterm2) may have an option to specify shell explicitly, used that.

Related

Zprofile not found in Mac OS Terminal

I have a new mac that I have been setting up with homebrew, git, node, vs code etc. I noticed that some applications were somehow being installed on bash terminal instead of zsh terminal. Even though I was able to fix that, I now have an error message of
/Users/*****/.zprofile:1: = not found
I tried to create a z profile using
touch ~/.zprofile
How can I fix this error message?

After updating my Mac OS to Catalina, Flutter is not working anymore in Android Studio. I deleted and re-installed, but still not working

Please Please help. After updating the OS to Catalina, Android Studio would still open, but none of my Flutter apps will work and the emulators do not open (they say 'Loading')
I unistalled Flutter and re-installed it, but in the Terminal when I type in flutter doctor -v, it says "zsh: command not found: flutter"
Is this because I'm no longer using bin (or bash), and now using zsh?
Can someone tell me what I can do to solve this issue? Im not very good at entering Terminal commands, so what exactly would I type to fix this issue? (I'm a beginner)
When I was entering vim bash_profile in the Terminal, I entered the following as the Export Path:
export PATH="$PATH:/Users/raymondfontaine/Developer/flutter/bin"
I had the same problem and it occurred after switching from bash to zsh. A far as I know, you have three different options.
Switch your Terminal back from zsh to bash by typing chsh -s /bin/bash and restart your Terminal. Note: You can always switch back to zsh by typing chsh -s /bin/zsh and restarting your Terminal.
You can tell zsh to use the paths specified in your bash_profile file by typing source ~/.bash_profile into your Terminal. Note: You have to do this every time you open a new Terminal.
The two options above are probably not "Best Practice". The best solution would be to set environment variables for zsh as suggested by the flutter Tutorial: Update your Path.
In your case you have to type nano $HOME/.zshrc into your Terminal enter export PATH="$PATH:/Users/raymondfontaine/Developer/flutter/bin" there, save the file and restart the Terminal. After that flutter doctor -v should run as usual.
Also the emulators in Android Studio should load again. But if you still cannot start them via the Dropdown, try opening them via Tools > AVD Manager. This worked for me while they were not visible in the Dropdown Menu.

Mac can't open system vim in terminal

I tried to upgrade my system Vim from 7.3 to a high version so I used macport to do that. This newer version is located in /opt/local/bin/. Later I decided to uninstall it due to some reason.
Now I can't open my system Vim in the terminal, the error message is -bash: /opt/local/bin/vim: No such file or directory. Somehow the machine still thinks the vim is located in /opt/local/bin/.
Then weird thing happens, when I type which vim, it shows my vim located at /usr/local/bin, and there is indeed a vim folder in that directory, but I can't open it by typing vim in the terminal.
So here is the situation: I have two working versions of Vim in my machine, a 7.3 version in /usr/bin and a 7.4 version in /usr/local/bin(I don't know how I got this one). Both working (I have to type the whole directory /urs/bin/vim or /urs/local/bin/vim), but can't be opened in the terminal by simply typing vim.
Updates:
now I can use vi or vim, but the problem is, the former opens 7.3 whereas the latter opens 7.4
At the current command window, type:
$ hash -r
then try running vim again. Or create a new window and try in that.
Bash remembered where vim was found, and expects to find it there again. When you removed vim, it got upset and complained (rather than try to find it again before complaining). Using hash -r vim forgets all previously hashed commands and then finds vim explicitly. Run hash with no options to see what it knows.
See the Bash manual on hash for more information.
The default Vim is /usr/bin/vim. There is absolutely no reason whatsoever to change it.
If you want a more up-to-date Vim, install MacVim and use the bundled mvim script instead of vim.

How to open a window from mac terminal

this is the first time I ask on stackoverflow because I can't find the answer anywhere. I use emacs to write all my code and I just switched from ubuntu to mac os. One problem has been bothering me: How could you open emacs window from mac terminal just like you would open firefox window from terminal on Linux system? I know the way it works for Linux system is that, whenever you type a command from terminal, the terminal search for the binary in you PATH and execute it. Is it the case for Mac that you can only open applicaiton in window form under "/Application" directory and all binaries opened from terminal are in non-window form? Big thanks!!
The pre-installed Emacs that comes with OS X is built without the GUI. Hence
$ emacs # in the shell/terminal
will NOT open a graphical window, and instead will open up the text/terminal version instead. Note that this version (installed at /usr/bin/emacs) is also old, and is at 22.1.1 in Mountain Lion.
To get the behavior you desire (and also get the latest version of Emacs as a bonus), you can download the latest Emacs build. This is available at various places, including http://emacsforosx.com/.
Most of these pre-built Emacs are installed under /Applications, and in order to invoke from the terminal, you will need to specify the full path to the binary, which usually is:
/Applications/Emacs.app/Contents/MacOS/Emacs
You can create a simple alias to this binary in your .bashrc as:
alias emacs=/Applications/Emacs.app/Contents/MacOS/Emacs
and then invoke emacs in its full glory from the command line.
I just tried
/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal &
and it did open a new window just fine.
OS X 10.7.4 here.
EDIT: Indeed if I try:
open /Applications/Utilities/Terminal.app
No new terminal window is opened
But,
open --new /Applications/Utilities/Terminal.app
works also, and is probably better than my first option because the job is not tied to the terminal you started the new terminal with.
First, download a Mac OS/X emacs build from here: http://emacsformacosx.com/
Second, once it's installed, you can:
Open it from the command line with open -a emacs
Set it to run server mode in your .emacs init, and then at the
command line type emacsclient foo for file foo.
I'd recommend either getting emacs via fink, or going to here: http://emacsformacosx.com/
This will allow you to install a local version of emacs that runs through the X server, and thus has the full GUI interface.
not sure if u're looking for something like this
open /path/to/some.app

Can't launch anything from terminal after uninstalling fink! Mac Lion

I've got a big problem, I can't launch anything from the terminal, not python, not emacs (or aquamacs), not even 'which'.
I was using homebrew to try to install ffmpeg and was having difficulties so I decided to pay attention to the warning that always come up advising me to uninstall fink. I removed the sw directory from my root directory, which is what the fink website told me to do and was confirmed on many blogs and message boards after a quick google search.
And since then nothing has worked, I'm almost certain that this was the cause of the problem because after removing sw I immediately tried home brew again and it said 'brew: command not found'. I get the same warning with any and every program I try to launch.
I use Mac OS Lion on a 6 year old MacBook.
Any ideas?
You probably busted your PATH. You can use absolute paths to commands until you get it fixed. For example:
/bin/mv ~/.profile ~/.profile.bak
/bin/mv ~/.bash_profile ~/.bash_profile.bak
Then open a new Terminal window, where standard things should now work. and repair your profile script.

Resources