nushell: Incorrect `size` statistics output

Describe the bug

Incorrect size statistics output

How to reproduce

"There are seven words in this sentence" | size | select lines get output lines 0 '大家好' | size | select words get output words 1 '今天天气真好' | size | select words get output words 1

Expected behavior

"There are seven words in this sentence" | size | select lines should output lines 1 '大家好' | size | select words should output words 3 '今天天气真好' | size | select words should output words 6

Screenshots

No response

Configuration

key value
version 0.59.1
branch main
short_commit 01c1e5e8
commit_hash 01c1e5e8b0e243dbf7dfc4d3673e6f3f629ace30
commit_date 2022-03-19 14:52:50 +00:00
build_os macos-x86_64
rust_version rustc 1.59.0 (9d1b2106e 2022-02-23)
rust_channel stable-x86_64-apple-darwin
cargo_version cargo 1.59.0 (49d8809dc 2022-02-10)
pkg_version 0.59.1
build_time 2022-03-19 23:04:50 +08:00
build_rust_channel release
features dataframe, default, trash, which, zip
installed_plugins gstat

Additional context

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 19 (9 by maintainers)

Most upvoted comments

There is this https://github.com/dead10ck/uwc but it looks pretty old. <-- I take it back. I like this code. We could just adopt it.

That’s because the way you count lines is by counting line endings. I may take a look tomorrow if I have time. I may be able to take the lines code and slap it into the lines part of the size code. Not sure.