Compiling Your Own SHELL

3 April, 2026 - Tags: fish, shell


this is my guide on compiling a shell and using the same. It's fun.

fish is my main shell that I use as a daily driver. below are the steps to compile your shell and using it. This guide focuses on fish but you should be able to do it for bash and some other shell as well.

git clone --depth=1 https://github.com/fish-shell/fish-shell
cd fish-shell
# following upstream build instructions
cd build
cmake -DCMAKE_INSTALL_PREFIX=/opt/kranurag/core/ ..
cmake --build .
cmake --install .

I wanted to have a path in my machine that's custom to me so I went with /opt/kranurag/core prefix above.

after this, I had it installed and I inspected /opt/kranurag/core.

Now it was time to change my shell. I uninstalled the default installation from package manager using brew remove fish

and now it was time to change shell to my own compiled one using chsh

I ran the following command chsh -s /opt/kranurag/core/bin/fish and got an error.

$ chsh -s /opt/kranurag/core/bin/fish
Changing shell for <user>.
Password for <user>:
chsh: /opt/kranurag/core/bin/fish: non-standard shell

I asked gpt about it and it said to me that I need to append my custom shell into /etc/shells with was TIL. I added /opt/kranurag/core/bin/fish to /etc/shells and ran it again and this time it worked.

$ sudo echo /opt/kranurag/core/bin/fish >> /etc/shells
Password:
$ chsh -s /opt/kranurag/core/bin/fish