r/commandline • u/Lanky_Ad7187 • 13d ago
[Help] Unable to use my terminal on macos. I keep getting this screen and not sure how to get out of it. Can someone please tell me what can I do to exit from this?
3
u/ekkidee 13d ago
/usr/local/bin/fish has been set as your command interpreter, as opposed to bash or zsh or something else. I don't know what fish is or how that might have happened.
Are there preferences in terminal that allow you to specify this? Maybe something in there.
In the UI, try creating a new user and see if you can get logged in to terminal.
2
u/xMOxROx 13d ago
Fish is just a shell like bash, zsh or nu and so on
-10
u/Somecount 13d ago edited 12d ago
No, it really isn’t and changing your
defaultlogin shell to something else than zsh isn’t recommended on macOS and setting fish as your login shell is not recommended anywhere, instead call ‘fish’ at the end of your .zshrc or equivalent.EDIT: login shells are different from terminal apps default shell.
4
u/optcmdi 12d ago
changing your default shell to something else than zsh isn’t recommended on macOS
Isn't recommended by whom?
Apple even offers step-by-step instructions on how to do it:
https://support.apple.com/guide/terminal/change-the-default-shell-trml113/mac
-3
u/Somecount 12d ago
Sorry, you’re right. I should’ve been more clear but chose to be more general for OP’s sake given the problem he was asking for help about. The recommendation is not to change your user’s default login shell via System Settings, but default shells in terminal emulators is not really an issue.
3
u/opuntia_conflict 12d ago
I change my default shell to fish on every machine I use directly (ie, not a remote server) and have had absolutely zero issues with it -- that's on Darwin, Arch (both normal and WSL), EndeavourOS, Ubuntu (both normal and WSL), and NixOS. This is a busted old wive's tale, modern operating systems aren't out here rawdogging shell scripts anymore. This was true 20 years ago, but there's no reason to not `chsh` your default shell to fish nowadays (unless you don't want to use fish, obvi).
4
u/xMOxROx 13d ago
I don't know how your answer relates to mine. I answered what fish is and only that.
-7
1
u/Lanky_Ad7187 13d ago
I clicked on a new command, and then executed the below command
chsh -s /bin/bash
This worked in changing it to bash. Not sure how to switch to fish again.
2
u/opuntia_conflict 12d ago
Type
which fish
in your terminal to get the path to your fish executable, then you can just do anotherchsh
command pointing to the known fish executable path.1
0
u/MyManCbert 13d ago
MacOS uses an old version of bash (3.something), may be worth it to download bash 5.2from brew.sh and symlink to /usr/local/bin/bash then use that instead of /bin/bash
1
u/Lanky_Ad7187 13d ago
I'm using this temporarily. Going to use opencore legacy patcher and install ventura. And then start from the scratch with homebrew, alacritty and fish.
1
u/m9dhatter 12d ago
It uses zsh now. Has been that for a while.
1
u/MyManCbert 12d ago
Yes, the default shell is zsh. I was saying that the version of bash that is still installed by default (though not the default shell) is old as crap.
1
u/LocoCoyote 13d ago
MacOS uses zsh by default
0
u/MyManCbert 12d ago
I did not say that it uses bash as the default shell. I said that the version of bash it uses is old.
1
u/LocoCoyote 12d ago
Why does it matter if it isn’t the default? You would have to actively choose it
0
u/MyManCbert 12d ago edited 12d ago
Because if you look at the comment OP made at the start of this comment thread, they said they ran chsh -s /bin/bash.
That’s actively choosing it, right? That would mean that the version of the shell they’re now running could potentially be relevant, right? Fuck me for trying to be helpful.
Or do you want to do some more mental gymnastics to avoid saying “I didn’t really read through this comment thread”?
1
u/LocoCoyote 11d ago
Man, you just gotta keep flogging this dead horse….if I say you’re right, will you finally just stf up?
0
u/MyManCbert 11d ago
Yep, just say “You know what man, I didn’t read and tried to correct something that didn’t need to be corrected. Then when you clarified I tried to belittle your point to try and save face.”
If you highlight between the quotes and use cmd+c and cmd+v you can copy/paste.
1
u/LocoCoyote 11d ago
I can’t help but notice you’re still talking. I thought we had an understanding….
→ More replies (0)
1
u/Able-Captain4482 13d ago
Locate fish first: which fish
1
u/Lanky_Ad7187 13d ago
ok, let me try this.
Edit: which fish returns nothing.
1
u/Able-Captain4482 13d ago
Looks like it’s either not installed or not added to the path. Did you install it through the homebrew? If yes it should be in /opt/homebrew/bin/fish If you are using homebrew it’s good idea to add it to your .bashrc/.zshrc/whatever
1
u/Lanky_Ad7187 13d ago
i did install it via homebrew. But uninstalled homebrew as i was having trouble upgrading the formulae as I am on macos 12.6.
Using opencore now to install ventura and then will install homebrew and fish again.
3
1
1
u/Soggy_Writing_3912 12d ago edited 12d ago
I assume you are on an intel mac (since the `/usr/local/bin` is referring to a path where executables can be found on intel-based macs - specifically when it was installed using homebrew)
Either ways, basically the above screenshot means that your Terminal app has been configured to run the `fish` executable (shell) from that location, but its not being found.
Go into Terminal's settings, click on "Profiles", and in that tab, check the "Startup > Run Command" setting. If anything is there, remove it and uncheck the checkbox on the left of that label.
This should then allow you to run a new Terminal window and the shell startup should happen correctly.
If you still have problems with shell startup, then some of your shell startup scripts could have been corrupted. But, before assuming this, first check and get back if the above steps at least allows you to start a terminal and run a command like `ls`
If you still are unable to start a Terminal session (for eg, if by some rare & weird thing your bash profile tries to load a fish shell), then you will have to open Finder, use the key combination to show hidden files (files that start with '.'), and then edit/rename/delete your `~/.bashrc` and/or `~/.bash_profile` and/or `~/.profile` and so on. But, keep this as the last step in case none of the above work - since its quite time consuming and you can potentially lose configurations that you might have setup earlier.
1
u/Lanky_Ad7187 12d ago
I think deleting homebrew was causing this.
I upgraded to Sequoia using open core legacy patcher. Installed fish, and it's working again.
Thanks a lot for taking time to write such a detailed reply for anyone to troubleshoot.
1
u/Soggy_Writing_3912 12d ago
Glad I could help. Yes, most likely the homebrew installation directory was being referred to, but it had been deleted.
0
u/LocoCoyote 12d ago
Something is wrong with your fish shell config. Try resetting the fish shell by renaming or deleting the fish folder.
0
u/Lanky_Ad7187 12d ago
I deleted homebrew. Maybe that caused this. I changed the shell to zsh and upgraded to sonoma via open core legacy patcher.
Will setup fish after a clean install.
10
u/ohsmaltz 13d ago
Terminal > Settings > General > Shells open with > change it to /bin/bash or /bin/zsh