Compare commits

...

15 Commits
0.6.0 ... 0.6.1

Author SHA1 Message Date
5676713b1f Update README.md 2019-12-01 07:12:14 +13:00
b59231d32b Merge pull request #1035 from jonathandturner/bump_to_0_6_1
Add 0.6.1 release
2019-11-30 10:11:31 -08:00
e530cf0a9d Add 0.6.1 release 2019-12-01 07:10:51 +13:00
1ba69e4b11 Merge pull request #1030 from jonathandturner/more_doc_updates
Update some command docs
2019-11-29 17:53:02 -08:00
f10390b1be Update some command docs 2019-11-30 14:24:39 +13:00
c2b1908644 Merge pull request #1029 from jonathandturner/fix_starship_env_var
Remove env var from starship
2019-11-29 12:00:10 -08:00
0a93335f6d Remove env var from starship 2019-11-30 08:38:44 +13:00
8e7acd1094 Update where.md 2019-11-29 08:41:27 +13:00
c6ee6273db Merge pull request #1015 from sebastian-xyz/doc
Add documentation for histogram, split-column
2019-11-28 11:19:36 -08:00
c77059f891 add documentation for from-json, from-yaml, history, split-row 2019-11-28 19:33:17 +01:00
5bdda06ca6 update histogram, nth documentation 2019-11-28 19:32:31 +01:00
d8303dd6d6 Merge pull request #1026 from est31/new-cargo-lock
Switch to the new Cargo.lock format
2019-11-27 19:11:54 -08:00
60ec68b097 Switch to the new Cargo.lock format
This was achieved by deleting Cargo.lock
and letting a recent Cargo nightly re-create
it. Support for the format was already
introduced in Rust 1.38, but currently,
stable releases of Cargo only retain it
if encountered but don't generate such
files by default.

The new format is smaller, better suited to
prevent merge conflicts and generates smaller
diffs at dependency updates, leading to
smaller git history.

You can read more about it in this PR: https://github.com/rust-lang/cargo/pull/7070
2019-11-28 03:27:37 +01:00
deae66c194 Cargo update
This performs a cargo update to allow the upcoming commit
that switches to the new Cargo.lock format to be only about
that format change.
2019-11-28 03:17:31 +01:00
0845572878 Add documentation for histogram, split-column 2019-11-26 20:47:34 +01:00
17 changed files with 1705 additions and 1389 deletions

2636
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
[package]
name = "nu"
version = "0.6.0"
version = "0.6.1"
authors = ["Yehuda Katz <wycats@gmail.com>", "Jonathan Turner <jonathan.d.turner@gmail.com>", "Andrés N. Robalino <andres@androbtech.com>"]
description = "A shell for the GitHub era"
license = "MIT"

View File

@ -173,7 +173,7 @@ We can pipeline this into a command that gets the contents of one of the columns
━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━┯━━━━━━━━━┯━━━━━━┯━━━━━━━━━
authors │ description │ edition │ license │ name │ version
─────────────────┼────────────────────────────┼─────────┼─────────┼──────┼─────────
[table: 3 rows] │ A shell for the GitHub era │ 2018 │ MIT │ nu │ 0.6.0
[table: 3 rows] │ A shell for the GitHub era │ 2018 │ MIT │ nu │ 0.6.1
━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━┷━━━━━━━━━┷━━━━━━┷━━━━━━━━━
```
@ -181,7 +181,7 @@ Finally, we can use commands outside of Nu once we have the data we want:
```
/home/jonathan/Source/nushell(master)> open Cargo.toml | get package.version | echo $it
0.6.0
0.6.1
```
Here we use the variable `$it` to refer to the value being piped to the external command.

View File

@ -9,22 +9,22 @@ Exits the nu shell. If you have multiple nu shells, use `exit --now` to exit all
```
```
/home/username/stuff/books> shells
---+---+------------+----------------------------
# | | name | path
---+---+------------+----------------------------
0 | | filesystem | /home/username/stuff/notes
1 | | filesystem | /home/username/stuff/videos
2 | X | filesystem | /home/username/stuff/books
---+---+------------+----------------------------
/home/username/stuff/books> exit
/home/username/stuff/videos> shells
---+---+------------+----------------------------
# | | name | path
---+---+------------+----------------------------
0 | | filesystem | /home/username/stuff/notes
1 | X | filesystem | /home/username/stuff/videos
---+---+------------+----------------------------
/home/username/stuff/videos> exit --now
> shells
━━━┯━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# name path
───┼───┼────────────┼─────────────────────────────────────
0 filesystem /home/jonathanturner/Source/nushell
1 filesystem /home
2 X filesystem /usr
━━━┷━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
> exit
> shells
━━━┯━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# name path
───┼───┼────────────┼─────────────────────────────────────
0 filesystem /home/jonathanturner/Source/nushell
1 X filesystem /home
━━━┷━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
> exit --now
exits both the shells
```

View File

@ -0,0 +1,33 @@
# from-json
Parse text as `.json` and create table. Use this when nushell cannot dertermine the input file extension.
Syntax: `from-json {flags}`
### Flags:
--objects
treat each line as a separate value
## Examples
```shell
> open command_from-json
[
{
title: "from-json",
type: "command",
flags: true
}
]
```
```shell
> open command_from-json | from-json
━━━━━━━━━━━┯━━━━━━━━━┯━━━━━━━
title │ type │ flags
───────────┼─────────┼───────
from-json │ command │ Yes
━━━━━━━━━━━┷━━━━━━━━━┷━━━━━━━
```

View File

@ -0,0 +1,24 @@
# from-yaml
Parse text as `.yaml/.yml` and create table.
Syntax: `from-yaml`
## Examples
```shell
> open command_from-yaml
title: from-yaml
type: command
flags: false
```
```shell
> open command_from-yaml | from-yaml
━━━━━━━━━━━┯━━━━━━━━━┯━━━━━━━
title │ type │ flags
───────────┼─────────┼───────
from-yaml │ command │ No
━━━━━━━━━━━┷━━━━━━━━━┷━━━━━━━
```

View File

@ -0,0 +1,80 @@
# histogram
Creates a new table with a histogram based on the column name passed in.
Syntax: `histogram <column_name> ...args`
### Parameters
* `<column-name>`: name of the column to graph by
* `args`: column name to give the histogram's frequency column
## Examples
Let's say we have this file `random_numers.csv` which contains 50 random numbers.
**Note**: The input doesn't have to be numbers it works on strings too. Try it out.
```shell
> open random_numbers.csv
open random_numbers2.csv
━━━━┯━━━━━━━━━━━━━━━━
# │ random numbers
────┼────────────────
00
15
25
...
470
482
494
━━━━┷━━━━━━━━━━━━━━━━
```
If we now want to see how often the different numbers were generated, we can use the `histogram` function:
```shell
> open random_numbers2.csv | histogram "random numbers"
━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# │ random numbers │ frequency
───┼────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────
00 │ ****************************************************************************************************
11 │ ******************************
22 │ *************************************************************
33 │ *********************************************************************
44 │ *****************************************************
55 │ *********************************************************************
━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
```
We can also set the name of the second column or sort the table:
```shell
> open random_numbers2.csv | histogram "random numbers" probability
━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# │ random numbers │ probability
───┼────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────
00 │ ****************************************************************************************************
11 │ ******************************
22 │ *************************************************************
33 │ *********************************************************************
44 │ *****************************************************
55 │ *********************************************************************
━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
```
```shell
> open random_numbers2.csv | histogram "random numbers" probability | sort-by probability
━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# │ random numbers │ probability
───┼────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────
01 │ ******************************
14 │ *****************************************************
22 │ *************************************************************
33 │ *********************************************************************
45 │ *********************************************************************
50 │ ****************************************************************************************************
━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
```

17
docs/commands/history.md Normal file
View File

@ -0,0 +1,17 @@
# history
Displays the last 100 commands.
## Example
```shell
> history
━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# │ <value>
────┼───────────────────────────────────────────────────────────────────────────
...
97 │ ls
98 │ ls | where accessed < 1d
99cd
━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
```

View File

@ -6,17 +6,17 @@ This command increments the value of variable by one.
```shell
> open rustfmt.toml
---------
━━━━━━━━━
edition
---------
─────────
2018
---------
━━━━━━━━━
> open rustfmt.toml | inc edition
---------
━━━━━━━━━
edition
---------
─────────
2019
---------
━━━━━━━━━
```
```shell

View File

@ -3,10 +3,13 @@
This command returns the nth row of a table, starting from 0.
If the number given is less than 0 or more than the number of rows, nothing is returned.
## Usage
### Usage
```shell
> [input-command] | nth [row-number]
> [input-command] | nth <row number> ...args
```
### Parameters:
* `<row number>` the number of the row to return
* `args`: Optionally return more rows
## Examples
```shell
@ -21,11 +24,19 @@ If the number given is less than 0 or more than the number of rows, nothing is r
━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━┷━━━━━━━━━━┷━━━━━━━━┷━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━
> ls | nth 0
━━━━━━━━━━━━┯━━━━━━┯━━━━━━━━━━┯━━━━━━━━┯━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━
name │ typereadonly │ size │ accessed │ modified
────────────┼──────┼──────────┼────────┼───────────────┼───────────────
Cargo.toml │ File │ │ 239 B │ 2 minutes ago │ 2 minutes ago
━━━━━━━━━━━━┷━━━━━━┷━━━━━━━━━━┷━━━━━━━━┷━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━
━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━┯━━━━━━━━━━┯━━━━━━━━┯━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━
# │ name │ type │ readonly │ size │ accessed │ modified
───┼────────────┼───────────┼──────────┼────────┼───────────────┼───────────────
0 Cargo.toml │ File │ │ 239 B │ 2 minutes ago │ 2 minutes ago
━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━┷━━━━━━━━━━┷━━━━━━━━┷━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━
> ls | nth 0 2
━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━┯━━━━━━━━━━┯━━━━━━━━┯━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━
# │ name │ type │ readonly │ size │ accessed │ modified
───┼────────────┼───────────┼──────────┼────────┼───────────────┼───────────────
0 │ Cargo.toml │ File │ │ 239 B │ 2 minutes ago │ 2 minutes ago
2 │ .gitignore │ File │ │ 19 B │ 2 minutes ago │ 2 minutes ago
━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━┷━━━━━━━━━━┷━━━━━━━━┷━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━
> ls | nth 5
```

View File

@ -6,21 +6,21 @@ Lists all the active nu shells with a number/index, a name and the path. Also ma
```
> shells
---+---+------------+---------------
# | | name | path
---+---+------------+---------------
0 | | filesystem | /usr
1 | | filesystem | /home
2 | X | filesystem | /home/username
---+---+------------+---------------
━━━┯━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# name path
───┼───┼────────────┼─────────────────────────────────────
0 filesystem /home/jonathanturner/Source/nushell
1 filesystem /usr
2 X filesystem /home
━━━┷━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
```
```
/> shells
---+---+-------------------------------------------------+------------------------------------
# | | name | path
---+---+-------------------------------------------------+------------------------------------
0 | | filesystem | /Users/username/Code/nushell
1 | X | {/Users/username/Code/nushell/Cargo.toml} | /
---+---+-------------------------------------------------+------------------------------------
━━━┯━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# name path
───┼───┼──────────────────────────────────────────────────┼─────────────────────────────────────
0 filesystem │ /home/jonathanturner/Source/nushell
1 X {/home/jonathanturner/Source/nushell/Cargo.toml} │ /
━━━┷━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
```

View File

@ -1,5 +1,5 @@
# env
# sort-by
The `sort-by` command sorts the table being displayed in the terminal by a chosen column(s).

View File

@ -0,0 +1,72 @@
# split-column
Split row contents across multiple columns via the separator.
Syntax: `split-column <separator> ...args{flags}`
### Parameters
* `<seperator>`: string that denotes what separates columns
* `args`: column names to give the new columns. If not specified they will be set to `Column1` `Column2` ...
### Flags
--collapse-empty
Removes empty columns
## Examples
If we have file structured like this:
```shell
0.12643678160919541 | 0.6851851851851852 | 0.273972602739726
0.28735632183908044 | 0.09259259259259259 | 0.6986301369863014
0.8045977011494253 | 0.8148148148148148 | 0.7397260273972602
0.28735632183908044 | 0.09259259259259259 | 0.547945205479452
0.6896551724137931 | 0.7037037037037037 | 1.2465753424657535
0.6896551724137931 | 0.8333333333333334 | 0.4657534246575342
0.9080459770114943 | 1.3333333333333333 | 0.4931506849315068
0.9310344827586207 | 1.1296296296296295 | 0.7123287671232876
0.3448275862068966 | 0.018518518518518517 | 0.6575342465753424
1.0459770114942528 | 1.0925925925925926 | 0.6164383561643836
```
We can build a table from it using the `split-column` command
```shell
> open coordinates.txt | lines | split-column " | "
━━━┯━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━
# │ Column1 │ Column2 │ Column3
───┼─────────────────────┼──────────────────────┼────────────────────
0 │ 0.12643678160919541 │ 0.6851851851851852 │ 0.273972602739726
1 │ 0.28735632183908044 │ 0.09259259259259259 │ 0.6986301369863014
2 │ 0.8045977011494253 │ 0.8148148148148148 │ 0.7397260273972602
3 │ 0.28735632183908044 │ 0.09259259259259259 │ 0.547945205479452
4 │ 0.6896551724137931 │ 0.7037037037037037 │ 1.2465753424657535
5 │ 0.6896551724137931 │ 0.8333333333333334 │ 0.4657534246575342
6 │ 0.9080459770114943 │ 1.3333333333333333 │ 0.4931506849315068
7 │ 0.9310344827586207 │ 1.1296296296296295 │ 0.7123287671232876
8 │ 0.3448275862068966 │ 0.018518518518518517 │ 0.6575342465753424
9 │ 1.0459770114942528 │ 1.0925925925925926 │ 0.6164383561643836
━━━┷━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━
```
And give names to the columns
```shell
> open coordinates.txt | lines | split-column " | " x y z
━━━┯━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━━
# │ x │ y │ z
───┼─────────────────────┼──────────────────────┼────────────────────
0 │ 0.12643678160919541 │ 0.6851851851851852 │ 0.273972602739726
1 │ 0.28735632183908044 │ 0.09259259259259259 │ 0.6986301369863014
2 │ 0.8045977011494253 │ 0.8148148148148148 │ 0.7397260273972602
3 │ 0.28735632183908044 │ 0.09259259259259259 │ 0.547945205479452
4 │ 0.6896551724137931 │ 0.7037037037037037 │ 1.2465753424657535
5 │ 0.6896551724137931 │ 0.8333333333333334 │ 0.4657534246575342
6 │ 0.9080459770114943 │ 1.3333333333333333 │ 0.4931506849315068
7 │ 0.9310344827586207 │ 1.1296296296296295 │ 0.7123287671232876
8 │ 0.3448275862068966 │ 0.018518518518518517 │ 0.6575342465753424
9 │ 1.0459770114942528 │ 1.0925925925925926 │ 0.6164383561643836
━━━┷━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━━
```

View File

@ -0,0 +1,34 @@
# split-row
Split row contents over multiple rows via the separator.
Syntax: `split-row <separator>`
### Parameters:
* `<separator>` the character that denotes what separates rows
## Examples
We can build a table from a file that looks like this
```shell
> open table.txt
4, 0, 2, 0, 7, 8
```
using the `split-row` command.
```shell
open table.txt | split-row ", "
━━━┯━━━━━━━━━
# │ <value>
───┼─────────
04
10
22
30
47
58
━━━┷━━━━━━━━━
```

View File

@ -9,6 +9,6 @@ Outputs the nushell version.
━━━━━━━━━
version
─────────
0.3.0
0.6.0
━━━━━━━━━
```

View File

@ -2,6 +2,39 @@
This command filters the content of a table based on a condition passed as a parameter, which must be a boolean expression making use of any of the table columns. Other commands such as `ls` are capable of feeding `where` with their output through pipelines.
Where has two general forms:
- `where <column_name> <comparison> <value>`
- `where <column_name>`
## Where with comparison
In the first form, `where` is passed a column name that the filter will run against. Next, is the operator used to compare this column to its value. The following operators are supported:
- `<` (less than)
- `<=` (less than or equal)
- `>` (greater than)
- `>=` (greater than or equal)
- `!=` (not equal)
- `==` (equal)
Strings have two additional operators:
- `=~` (fuzzy match to allow)
- `!~` (fuzzy match to not allow)
Dates can also be compared using the duration types. For example, `where accessed > 2w` will check the date in accessed to see if it's greater than 2 weeks ago. Durations currently allow these abbreviations:
- `1s` (one second)
- `1m` (one minute)
- `1h` (one hour)
- `1d` (one day)
- `1w` (one week)
- `1M` (one month)
- `1y` (one year)
## Boolean check
Where with the form `| where readonly` is used to check boolean values. For example, the command `ls --full | where readonly` will list only those files that are readonly.
## Usage
```shell
> [input-command] | where [condition]
@ -11,24 +44,47 @@ This command filters the content of a table based on a condition passed as a par
```shell
> ls | where size > 4kb
----+----------------+------+----------+----------+----------------+----------------
# | name | type | readonly | size | accessed | modified
----+----------------+------+----------+----------+----------------+----------------
0 | IMG_1291.jpg | File | | 115.5 KB | a month ago | 4 months ago
1 | README.md | File | | 11.1 KB | 2 days ago | 2 days ago
2 | IMG_1291.png | File | | 589.0 KB | a month ago | a month ago
3 | IMG_1381.jpg | File | | 81.0 KB | a month ago | 4 months ago
4 | butterfly.jpeg | File | | 4.2 KB | a month ago | a month ago
5 | Cargo.lock | File | | 199.6 KB | 22 minutes ago | 22 minutes ago
━━━┯━━━━━━━━━━━━┯━━━━━━┯━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━┯━━━━━━━━━━━━━
# name type │ size │ created │ accessed modified
───┼────────────┼──────┼─────────┼─────────────┼─────────────┼─────────────
0 │ Cargo.lock │ File │ 87.2 KB │ 7 hours ago │ 7 hours ago │ 7 hours ago
1 README.md │ File │ 19.5 KB │ 7 hours ago 7 hours ago │ 7 hours ago
2 │ Cargo.toml │ File │ 4.7 KB │ 7 hours ago │ 7 hours ago │ 7 hours ago
━━━┷━━━━━━━━━━━━┷━━━━━━┷━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━┷━━━━━━━━━━━━━
```
```shell
> ps | where cpu > 10
---+-------+----------+-------+-----------------------------
# | pid | status | cpu | name
---+-------+----------+-------+-----------------------------
0 | 1992 | Sleeping | 44.52 | /usr/bin/gnome-shell
1 | 1069 | Sleeping | 16.15 |
2 | 24116 | Sleeping | 13.70 | /opt/google/chrome/chrome
3 | 21976 | Sleeping | 12.67 | /usr/share/discord/Discord
> ps | where cpu > 0
━━━┯━━━━━━━┯━━━━━━━━━━━━━━━━━━━━━━━┯━━━━━━━━━━┯━━━━━━━━━━━━━━━━━━━
# pid │ name │ status cpu
───┼───────┼───────────────────────┼──────────┼───────────────────
0 1546 │ Xorg │ Sleeping │ 10.65405000000000
1 1769 │ gnome-shell │ Sleeping │ 5.271094000000000
2 2153 │ gnome-terminal-server │ Sleeping │ 5.193664000000000
3 13556 │ nu_plugin_ps │ Sleeping │ 40.70250000000000
━━━┷━━━━━━━┷━━━━━━━━━━━━━━━━━━━━━━━┷━━━━━━━━━━┷━━━━━━━━━━━━━━━━━━━
```
```shell
> ls | where accessed <= 1w
━━━┯━━━━━━━━━━━━━━━┯━━━━━━━━━━━┯━━━━━━━━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━
# │ name │ type │ size │ accessed │ modified
───┼───────────────┼───────────┼──────────┼────────────┼────────────
0 │ Cargo.toml │ File │ 4.7 KB │ 2 days ago │ 2 days ago
1 │ target │ Directory │ 4.1 KB │ 2 days ago │ 2 days ago
2 │ Makefile.toml │ File │ 449 B │ 4 days ago │ 4 days ago
3 │ README.md │ File │ 19.5 KB │ 2 days ago │ 2 days ago
4 │ Cargo.lock │ File │ 170.7 KB │ 2 days ago │ 2 days ago
5 │ crates │ Directory │ 4.1 KB │ 2 days ago │ 2 days ago
6 │ TODO.md │ File │ 1.3 KB │ 2 days ago │ 2 days ago
━━━┷━━━━━━━━━━━━━━━┷━━━━━━━━━━━┷━━━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━
```
```shell
> ls | where name =~ "yml"
━━━━━━━━━━━━━┯━━━━━━┯━━━━━━━┯━━━━━━━━━━━━┯━━━━━━━━━━━━
name │ type │ size │ accessed │ modified
─────────────┼──────┼───────┼────────────┼────────────
.gitpod.yml │ File │ 780 B │ a week ago │ a week ago
━━━━━━━━━━━━━┷━━━━━━┷━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━━━━━
```

View File

@ -396,6 +396,7 @@ pub async fn cli() -> Result<(), Box<dyn Error>> {
let colored_prompt = {
#[cfg(feature = "starship-prompt")]
{
std::env::set_var("STARSHIP_SHELL", "");
starship::print::get_prompt(starship::context::Context::new_with_dir(
clap::ArgMatches::default(),
cwd,