Commit Graph

4833 Commits

Author SHA1 Message Date
Ray Henry
94ab981235
Fix "Index out of bounds" when input to the group-by filter is empty. #4369 (#4382)
* Fix "index out of bounds" when input to group-by is empty #4369

* Fix formatting #4369

* Adds test for empty input

Co-authored-by: Ray Henry <ray.henry@thermofisher.com>
2022-02-09 08:47:47 -06:00
JT
f9e1c4ef50
Use 'table' on scripts and -c commands (#4377)
* Use 'table' on scripts and -c commands

* Fix tests

* Oops, missed a spot
2022-02-09 05:58:54 -05:00
Stefan Holderbach
659da3c4a4
Make ANSI stripping lazy in more places (#4380)
Same rationale as in #4378

Also accelerate `grid`

before:

```
Command being timed: "./eager_nu -c for i in 0..100000 { echo whatever } | grid"
        User time (seconds): 0.21
        System time (seconds): 0.05
        Percent of CPU this job got: 36%
        Elapsed (wall clock) time (h:mm:ss or m:ss): 0:00.71
        Average shared text size (kbytes): 0
        Average unshared data size (kbytes): 0
        Average stack size (kbytes): 0
        Average total size (kbytes): 0
        Maximum resident set size (kbytes): 48112
        Average resident set size (kbytes): 0
        Major (requiring I/O) page faults: 0
        Minor (reclaiming a frame) page faults: 10580
        Voluntary context switches: 266
        Involuntary context switches: 2595
        Swaps: 0
        File system inputs: 0
        File system outputs: 0
        Socket messages sent: 0
        Socket messages received: 0
        Signals delivered: 0
        Page size (bytes): 4096
        Exit status: 0
```

after:

```
Command being timed: "./lazy_nu -c for i in 0..100000 { echo whatever } | grid"
        User time (seconds): 0.14
        System time (seconds): 0.05
        Percent of CPU this job got: 33%
        Elapsed (wall clock) time (h:mm:ss or m:ss): 0:00.60
        Average shared text size (kbytes): 0
        Average unshared data size (kbytes): 0
        Average stack size (kbytes): 0
        Average total size (kbytes): 0
        Maximum resident set size (kbytes): 48272
        Average resident set size (kbytes): 0
        Major (requiring I/O) page faults: 1
        Minor (reclaiming a frame) page faults: 10582
        Voluntary context switches: 286
        Involuntary context switches: 831
        Swaps: 0
        File system inputs: 56
        File system outputs: 0
        Socket messages sent: 0
        Socket messages received: 0
        Signals delivered: 0
        Page size (bytes): 4096
        Exit status: 0
```
2022-02-08 18:25:31 -06:00
Stefan Holderbach
9c7feb2b19
Reduce table allocs: only strip ANSI if necessary (#4378)
For the width calculations for table layout the `strip_ansi` function
has to be called frequently. By checking for the ASCII control chars
(0x00 to 0x1f) except `\n` that are stripped by `strip_ansi_escapes` the number of
necessary allocations can be reduced significantly for the simple case
of text not containing ANSI escapes.

**Benchmark:**

```
nu -c "for i in 0..1000 { ls } | flatten | table"
```

**Allocation reduction**

Running on the nushell repo root as the directory, this change reduces the
allocation volume by approximately 400 MB

(Measured run via KDE heaptrack)
**Speed improvement to output**

Measured via `/usr/bin/time -v`

*before*

```
Command being timed: "./eager_nu -c for i in 0..1000 {ls} | flatten | table"
	User time (seconds): 0.87
	System time (seconds): 0.14
	Percent of CPU this job got: 87%
	Elapsed (wall clock) time (h:mm:ss or m:ss): 0:01.16
	Average shared text size (kbytes): 0
	Average unshared data size (kbytes): 0
	Average stack size (kbytes): 0
	Average total size (kbytes): 0
	Maximum resident set size (kbytes): 18888
	Average resident set size (kbytes): 0
	Major (requiring I/O) page faults: 0
	Minor (reclaiming a frame) page faults: 4809
	Voluntary context switches: 38
	Involuntary context switches: 14
	Swaps: 0
	File system inputs: 0
	File system outputs: 0
	Socket messages sent: 0
	Socket messages received: 0
	Signals delivered: 0
	Page size (bytes): 4096
	Exit status: 0
```

*after*

```
Command being timed: "./lazy_nu -c for i in 0..1000 {ls} | flatten | table"
	User time (seconds): 0.63
	System time (seconds): 0.14
	Percent of CPU this job got: 80%
	Elapsed (wall clock) time (h:mm:ss or m:ss): 0:00.97
	Average shared text size (kbytes): 0
	Average unshared data size (kbytes): 0
	Average stack size (kbytes): 0
	Average total size (kbytes): 0
	Maximum resident set size (kbytes): 18660
	Average resident set size (kbytes): 0
	Major (requiring I/O) page faults: 0
	Minor (reclaiming a frame) page faults: 5149
	Voluntary context switches: 24
	Involuntary context switches: 5
	Swaps: 0
	File system inputs: 0
	File system outputs: 0
	Socket messages sent: 0
	Socket messages received: 0
	Signals delivered: 0
	Page size (bytes): 4096
	Exit status: 0
```
2022-02-08 17:43:32 -06:00
panicbit
cf20eed7bc
Support records in reject command (#4373)
* support records in reject command

* add reject command tests
2022-02-08 15:57:46 -05:00
Darren Schroeder
6d303f2ca3
update starship docs (#4375) 2022-02-08 13:08:02 -06:00
JT
b16e72f0a5
Update README.md 2022-02-08 13:59:08 -05:00
JT
56ba57c74a
Update README.md 2022-02-08 13:57:40 -05:00
Darren Schroeder
baceb54660
update ls_colors defaults (#4371) 2022-02-08 11:13:04 -06:00
JT
19caef260d
Fix 'enter' to expand path before checking for it (#4370) 2022-02-08 11:21:17 -05:00
Darren Schroeder
565be6aaef
change pivot to transpose 2022-02-08 09:32:27 -06:00
JT
7242e52faa
Merge pull request #4364 from nushell/merge-engine-q
Merge engine-q into Nushell (second try)
2022-02-08 10:02:28 -05:00
JT
101f4f62a8 gitignore conflict fix 2022-02-08 09:23:41 -05:00
JT
5fabfda57b merge main 2022-02-08 08:28:21 -05:00
JT
a660720b68
Bump to 0.44 (#4365) 2022-02-07 20:15:46 -05:00
JT
d70d91e559 Remove old nushell/merge engine-q 2022-02-07 14:54:06 -05:00
Fernando Herrera
10c4c50f1f removed old files 2022-02-07 19:28:22 +00:00
Fernando Herrera
dbcadbc12c moved folders 2022-02-07 19:23:12 +00:00
Fernando Herrera
fdce6c49ab engine-q merge 2022-02-07 19:11:34 +00:00
JT
9259a56a28
Update README.md 2022-02-07 08:22:31 -05:00
Onur Şahin
265ee1281d
Drop with iter range (#4242)
* Allow range in 'drop nth'

* Unit tests for drop nth range

* Add range case to the description

* Fix description 2

* format fixes

* Fix example and some refactoring

* clippy fixes
2022-02-07 08:02:35 -05:00
JT
a78c82d811
Make PipelineData helpers collect rawstreams (#969) 2022-02-07 07:44:18 -05:00
JT
3ab55f7de9
bump reedline (#970) 2022-02-07 07:40:17 -05:00
JT
84d3620d9b
Oops, match semantics of each group/window (#967) 2022-02-06 21:26:01 -05:00
JT
8a373dd554
Add each window (#966) 2022-02-06 20:23:18 -05:00
JT
c3e0e8eb5c
Add par-each group (#965) 2022-02-06 19:28:09 -05:00
JT
de4449c3ee
Fix completion duplicates (#964) 2022-02-06 16:33:33 -05:00
Fernando Herrera
796b7a1962
Reedline bump (#962)
* reedline bump

* reedline bump

* reedline bump
2022-02-06 18:18:32 +00:00
JT
a911b21256
Switch more commands to redirecting blocks (#956) 2022-02-05 21:03:06 -05:00
Stefan Holderbach
80306f9ba6
Update reedline to race-condition-free history (#955) 2022-02-05 18:16:21 -06:00
Darren Schroeder
2dd32c2b88
Rename some files (#952)
* renamed some files

* clippy

* update tests
2022-02-05 12:35:02 -05:00
JT
3eba90232a
Port each group (#953) 2022-02-05 12:34:35 -05:00
JT
c4858fb202
Remove broken error make examples (#951) 2022-02-05 12:01:08 -05:00
JT
8a93548de2
Error make (#948)
* Add `error make` and improve `metadata`

* Allow metadata to work on just a pipeline
2022-02-05 09:39:51 -05:00
Michael Angerman
e45e8109aa
fix test math/avg.rs can_average_bytes (#946) 2022-02-05 07:01:10 -05:00
Darren Schroeder
709927cee4
Sort keystuff (#945)
* sort things

* reorg
2022-02-04 17:20:54 -06:00
Fernando Herrera
abaeffab91
default keybindings command (#943) 2022-02-04 17:20:40 -06:00
Michael Angerman
73dcec8ea1
fix some of the sort_by tests several more left to do (#942) 2022-02-04 13:51:49 -08:00
Darren Schroeder
b26acf97bd
a few more tests (#941) 2022-02-04 15:42:18 -06:00
JT
f29dbeddd7
Allow let-env to be dynamic (#940) 2022-02-04 16:19:13 -05:00
Darren Schroeder
8204cc4f28
fix ls and ls tests (#931)
* fix `ls` and ls tests

* tweak to ls so it doesn't scream on empty dirs

* clippy

* reworked `ls` to put in what was left out
2022-02-04 14:32:13 -06:00
Michael Angerman
c2f6dfa75c
add nth tests to mod.rs (#934) 2022-02-04 12:08:25 -08:00
JT
90f6b6aedf
Simplify describe (#933) 2022-02-04 14:51:36 -05:00
Darren Schroeder
ece1e43238
fix into filesize tests and filesize (#932)
* fix into filesize tests and filesize

* tweaks

* added span back for like the 10th time

* Update filesize.rs

Co-authored-by: JT <547158+jntrnr@users.noreply.github.com>
2022-02-04 13:26:08 -06:00
Jakub Žádník
fefd5fef12
Allow def-env to hide environment variables (#921) 2022-02-04 20:02:03 +02:00
Darren Schroeder
dd2d601471
fix lines tests (#930) 2022-02-04 11:34:01 -06:00
Darren Schroeder
c6dad0d5eb
fix find tests (#928) 2022-02-04 10:47:24 -06:00
JT
522a53af68
Add support for quick completions (#927) 2022-02-04 10:30:21 -05:00
JT
1a246d141e
Improve subcommand completions (#926) 2022-02-04 08:38:23 -05:00
Darren Schroeder
b86c6db400
fix cal tests (#925)
* fix 1 test

* missed 1 test
2022-02-04 07:24:36 -06:00