28
Completely Oxidizing My Terminal Setup
Hello!
I recently oxidized my terminal setup, by converting all of my terminal programs to rust based programs. There were some hiccups in making it all work together, but in the end, my new setup is :
Note : nushell and zellij both are still in their beta versions, and have few known issues, so if you want an absolutely reliable env, use bash/fish/zsh for shell and screen/tmux for terminal multiplexer.
Before changing this, I had already installed Alacritty and starship and had used it for few days before switching back to default gnome terminal emulator with starship. The main reason I switched back was that a lot of times I ran multiple processes in parallel, such as running react frontend and node backend. I was used to doing this using the tabs of gnome emulator, and as Alacritty has clearly specified in its Readme, it has no intention of adding a terminal multiplexer, and users would need to use an external one such as tmux to do that (Which makes sense).
Unfortunately, I didn't want to install and setup another program to make it work, and I needed the functionality of multiplexed terminals in single window, rather than opening a new window each time ; which is why I moved back to gnome terminal emulator. In this, I kept starship, as I really liked it, and it was quite useful.
I had checked out nushell about a year ago, and it seemed very interesting, but then I felt it was a little too complex, and I felt like I wouldn't need all the features it provides, so I didn't try using it.
Few days back, I came across this retweeted by official Rust twitter account, which explained how zellij, a rust terminal workspace solved some of the performance issues. (It is really well writter, do check it out!)
While checking out zellij, I remembered nushell, and went back to its site to check that out as well. This time it didn't felt as complex, as well as its features looked awesome (you can "preview" an image in the terminal itself 😲 😲 ).
With this, I decided to convert all my terminal setup to Rust.
I had already installed alacritty as per their installation guide, as well as had starship set up. Now I had to install and setup nushell and zellij.
Installation process was quite straightforward, using cargo, and for nushell I had to install some other libraries for extra features using apt-get, but it went smoothly following the instructions on their pages :
After the installation, it was time to set it all up together, where I hit a couple of issues. First, I wanted to integrate zellij with alacritty and nushell, so that it can manage multiple sessions.
Initially I though setting the startup command in nushell to zellij would work, as startup command are run at start of each shell session. But quickly I found out I was wrong, as after starting nushell, it would first run zellij, which would keep running with default bash shell, and thus nushell would not actually run until I quit zellij.
Then I found out that zellij can be launched with specific shell as an argument, and alacritty has an option to choose which shell to run in its configuration, which was great because I didn't want to change system default shell to nu (its still in beta).
So first, I copied default alacritty.yml
to my home directory. The default file comes when installing from source, or else can be copied from their github repository. It has an option somewhere in the middle for shell :
# Shell
#
# You can set `shell.program` to the path of your favorite shell, e.g.
# `/bin/fish`. Entries in `shell.args` are passed unmodified as arguments to the
# shell.
#
# Default:
# - (macOS) /bin/bash --login
# - (Linux/BSD) user login shell
# - (Windows) powershell
#shell:
# program: /bin/bash
# args:
# - --login
It is commented by default. I thought uncommenting and changing it to zellij , and passing the option to set shell to nushell would work, so I set it to :
shell:
program: ~/.cargo/bin/zellij
args:
- options --default-shell nu
Which ... didn't work. Whenever I would launch alacritty, and it would immediately close, with no error message. I tried opening it from commandline of gnome shell, but it didn't leave any error message there, and that lead me to go through its github issues, and find how to make it generate debug dump, which I though would be helpful to find what is the issue, ... but it didn't work either 😅 😄
After that I figured that it might be possible that it might be because I was giving all the arguments to it in a single arg. Usually when we give args, program gets them as array of strings, and then it can parse it, and [I think] shell splits it by space to form the array. But in this, all was in a single arg entry, and thus was getting sent to program (zellij) as single argument, instead of 'options' , '--default-shell' and 'nu' being separate args.
After figuring this out, I separated them as individual args, and finally my config looks as :
shell:
program: ~/.cargo/bin/zellij
args:
- options
- --default-shell
- nu
and viola! It worked. Now I had to only set starship as shell prompt which was easy, as nushell has that as an example. And my terminal setup was ready and oxidized. 🎉 🎉 🎉
Now it looks like :
So, did you find this interesting or helpful?
Did you already used any of these , or thinking of trying them out?
Let me know in the comments!
Thank you!
28