nushell/crates/nu-cli/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
..
completions Revert "Pipeline operators: && and ||" (#7452) 2022-12-13 16:36:13 +13:00
menus 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
commands.rs Remove perf flag to streamline logging configuration (#6834) 2022-10-21 10:20:21 -05:00
config_files.rs Improve empty pipelines (#7383) 2022-12-08 07:31:57 +13:00
eval_file.rs Add FILE_PWD environment variable when running 'nu script.nu' (#7424) 2022-12-10 19:23:44 +02:00
lib.rs Split merging of parser delta and stack environment (#6005) 2022-07-14 17:09:27 +03:00
nu_highlight.rs feat: add search terms to category of strings (#5723) 2022-06-06 08:47:09 -05:00
print.rs Improve empty pipelines (#7383) 2022-12-08 07:31:57 +13:00
prompt_update.rs Improve empty pipelines (#7383) 2022-12-08 07:31:57 +13:00
prompt.rs Add support to render right prompt on last line of the prompt (#6781) 2022-10-23 16:18:26 +02:00
reedline_config.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
repl.rs Make hook execution stream instead of collecting (#7440) 2022-12-12 15:23:04 -08:00
syntax_highlight.rs Revert "Pipeline operators: && and ||" (#7452) 2022-12-13 16:36:13 +13:00
util.rs Fix streaming page missing newline (#7466) 2022-12-14 16:45:37 +13:00
validation.rs Add an alias denylist for expansions (#4871) 2022-03-19 08:03:57 +13:00