# Rethinking Terminals
(*Friday, November 29, 2024 @ 22:00*)
---
# Warp Terminal
https://www.warp.dev
This is a subscription-based (with free tier) terminal that offers a number of modern features and a sleek, easily-customizable aesthetic.
# Starship
https://starship.rs/
# Nushell
[The Nushell Book](https://www.nushell.sh/book/#this-book)
**Nushell** attempts to take the Unix philosophy of shells, in which "pipes" connect commands together by passing around and manipulating data, and bring it into the modern age by combining a rich programming language with a full-featured terminal shell in a single package.
It primarily focuses on:
* Providing a cross-platform, modern feeling shell
* Solving problems as a modern programming language that works with the structure of your data
* Providing clear, useful error messages and clean IDE support
## Getting Started
The `ls` command works like you'd expect, but rather than outputting a blob of text in the form of strings, you get a structured table displaying the actual resultant data. The table allows us to work with the data more interactively and directly.
For example, we can take the results of the `ls` command, pipe it to the `sort-by` command and sort by `size`, and then `reverse` the order to get the biggest files on top:
```sh
ls | sort-by size | reverse
```
![[Pasted image 20241129221432.png]]
We can also filter the contents of the table so that only files over 1 kilobyte in size are displayed in the table by doing this:
```sh
ls | where size > 1kb
```
![[Pasted image 20241129221603.png]]
The `ps` command also works how you'd expect and displays a list of processes current running. We can filter it to only processes actively using the CPU, similar to how we filtered the data above with the `ls` command:
```sh
ps | where cpu > 5
```
![[Pasted image 20241129221811.png]]
Running `help commands` provides us with a large table of Nushell commands. It's too big to just scan through, so, for example, we can get a row for the `each` command by using:
```sh
help commands | where name == each | first
```
![[Pasted image 20241129224439.png]]
Retrieving a single row from a table gives us a **record**, which is a set of key-value pairs. Notice that "params" and "input_output" columns contain their own tables rather than just values. To view the columns in this embedded tables, you use the `get` command to retrieve them:
```sh
help commands | where name == each | first | get params
```
> [!tip] `get` Command
> `get` lets us jump into contents of structured data (a table, record, or list), and can also be passed nested columns to access data at any depth
To grab specific data from a greater depth, we can snag the `name` parameter from `params` via:
```sh
help commands | where name == each | first | get params.name
```
These nested columns are called **cell paths**. Cell paths also support row numbers, so the above command could also have been written like:
```sh
help commands | where name == each | get 0.params.name
```
> [!tip] Getting Help
> You can see the help text for any of Nu's built-in commands by using the `help` command *OR* by passing the `--help` flag to a command. You can also search for a topic by using `help -f <topic>`