nushell/crates/nu-command/src
Reilly Wood d9d9916ccc
Fix streaming page missing newline (#7466)
Fixes #7342. `0..1000 | table` before this change:


![image](https://user-images.githubusercontent.com/26268125/207474492-dead4267-d828-4840-8da0-4edfda3e3916.png)

`0..1000 | table` after this change:


![image](https://user-images.githubusercontent.com/26268125/207474583-26633db0-46c5-4c30-8681-654855e7042b.png)

When piping data to `table`, pages were not getting a newline at the
end[^1]. This problem was uncovered and exacerbated by the new
`display_output` hook which implicitly piped _everything_ to `table`.

## The Fix

`PagingTableCreator` now adds a newline to each page instead of relying
on later code to do it.

## Tests

I spent a while trying to write a regression test for this behaviour but
I couldn't get the test to fail before my fix! I think the test
infrastructure does something special with newlines when it's checking
command output. I eventually ran out of steam trying to investigate
that, sorry.

[^1]: unless the pipe to table was the implicit one that's done when
there is no `display_output` hook set. That situation was still working
OK.
2022-12-14 16:45:37 +13:00
..
bits Reduced LOC by replacing several instances of Value::Int {}, Value::Float{}, Value::Bool {}, and Value::String {} with Value::int(), Value::float(), Value::boolean() and Value::string() (#7412) 2022-12-09 11:37:51 -05:00
bytes Reduced LOC by replacing several instances of Value::Int {}, Value::Float{}, Value::Bool {}, and Value::String {} with Value::int(), Value::float(), Value::boolean() and Value::string() (#7412) 2022-12-09 11:37:51 -05:00
charting Protocol: debug_assert!() Span to reflect a valid slice (#6806) 2022-12-03 11:44:12 +02:00
conversions into cellpath command (#7417) 2022-12-10 15:26:42 +02:00
core_commands Revert "Add pipeline operators to help" (#7454) 2022-12-13 16:49:00 +13:00
database Make SQLite queries cancellable (#7351) 2022-12-04 16:49:47 -08:00
dataframe Reduced LOC by replacing several instances of Value::Int {}, Value::Float{}, Value::Bool {}, and Value::String {} with Value::int(), Value::float(), Value::boolean() and Value::string() (#7412) 2022-12-09 11:37:51 -05:00
date Reduced LOC by replacing several instances of Value::Int {}, Value::Float{}, Value::Bool {}, and Value::String {} with Value::int(), Value::float(), Value::boolean() and Value::string() (#7412) 2022-12-09 11:37:51 -05:00
deprecated Add a deprecation note for removed build-string (#7307) 2022-12-01 16:26:59 +01:00
env add input_output_types() to benchmark,cd and config reset (#7455) 2022-12-13 06:10:55 -06:00
experimental Reduced LOC by replacing several instances of Value::Int {}, Value::Float{}, Value::Bool {}, and Value::String {} with Value::int(), Value::float(), Value::boolean() and Value::string() (#7412) 2022-12-09 11:37:51 -05:00
filesystem mkdir change flag -s to -v (#7462) 2022-12-13 11:56:44 -05:00
filters Replace row conditions with closures in commands (#7428) 2022-12-10 19:24:06 +02:00
formats Revert "Pipeline operators: && and ||" (#7452) 2022-12-13 16:36:13 +13:00
generators remove example missed from an earlier refactor (#7419) 2022-12-09 20:04:14 -06:00
hash add signature information when get help on one command (#7079) 2022-11-20 07:22:42 -06:00
math Reduced LOC by replacing several instances of Value::Int {}, Value::Float{}, Value::Bool {}, and Value::String {} with Value::int(), Value::float(), Value::boolean() and Value::string() (#7412) 2022-12-09 11:37:51 -05:00
misc Reduced LOC by replacing several instances of Value::Int {}, Value::Float{}, Value::Bool {}, and Value::String {} with Value::int(), Value::float(), Value::boolean() and Value::string() (#7412) 2022-12-09 11:37:51 -05:00
network Reduced LOC by replacing several instances of Value::Int {}, Value::Float{}, Value::Bool {}, and Value::String {} with Value::int(), Value::float(), Value::boolean() and Value::string() (#7412) 2022-12-09 11:37:51 -05:00
path Reduced LOC by replacing several instances of Value::Int {}, Value::Float{}, Value::Bool {}, and Value::String {} with Value::int(), Value::float(), Value::boolean() and Value::string() (#7412) 2022-12-09 11:37:51 -05:00
platform Fix du error message (#7460) 2022-12-13 13:11:55 +01:00
random add signature information when get help on one command (#7079) 2022-11-20 07:22:42 -06:00
shells Reduced LOC by replacing several instances of Value::Int {}, Value::Float{}, Value::Bool {}, and Value::String {} with Value::int(), Value::float(), Value::boolean() and Value::string() (#7412) 2022-12-09 11:37:51 -05:00
strings make split row works like python and rust ways (#7413) 2022-12-10 09:21:53 -06:00
system add input_output_types() to benchmark,cd and config reset (#7455) 2022-12-13 06:10:55 -06:00
viewers Fix streaming page missing newline (#7466) 2022-12-14 16:45:37 +13:00
default_context.rs Move 'where' to parser keywords; Add 'filter' command (#7365) 2022-12-10 19:23:24 +02:00
example_test.rs Reduced LOC by replacing several instances of Value::Int {}, Value::Float{}, Value::Bool {}, and Value::String {} with Value::int(), Value::float(), Value::boolean() and Value::string() (#7412) 2022-12-09 11:37:51 -05:00
input_handler.rs Replace all instances of 'column path' in help messages with 'cell path' (#7063) 2022-11-09 21:49:11 -08:00
lib.rs Feature cleanup (#7182) 2022-11-22 16:58:11 -08:00
sort_utils.rs Fix sort-by, path join and size error arrows (#7199) 2022-11-23 19:22:23 +13:00