mirror of
https://github.com/nushell/nushell
synced 2024-12-27 21:43:09 +00:00
69e4790b00
# Description I introduced a regression in #13272 that resulted in `detect columns --guess` to panic whenever it had to handle empty, whitespace-only, or non-whitespace-only lines that go all the way to the last column (and as such, cannot be considered to be lines that only have entries for the first colum). I fix this by detecting these cases and skipping them, since these are usually decoration lines. An example is the second line output by `winget list`: ![image](https://github.com/nushell/nushell/assets/20356389/06c873fb-0a26-45dd-b020-3bcc737d027f) What we don't want to skip, however, is lines that contain no whitespace, and fit into the detected first column, since these lines represent cases where data is only available for the first column, and are not just decoration lines. For example (made up example, there are no such entries in `winget lits`'s output), in this output we would not want to skip the `Docker Desktop` line : ``` Name Id Version Available Source ------------------------------------------------------------------------------------------------------------------------------------- AMD Software ARPMachineX64AMD Catalyst Install Manager 24.4.1 AMD Ryzen Master ARPMachineX64AMD Ryzen Master 2.13.0.2908 Docker Desktop Mozilla Firefox (x64 en-US) Mozilla.Firefox 127.0.2 winget ``` ![image](https://github.com/nushell/nushell/assets/20356389/12e31995-a7c1-4759-8c62-fb4fb199fd2e) NOTE: `winget list | detect columns --guess` does not panic, but sadly still does not work as expected. I believe this is not a nushell issue anymore, but a `winget` one. When being piped, `winget` seems to add extra whitespace and random `\r` symbols at the beginning of the text. This messes with the column detection, of course. ![image](https://github.com/nushell/nushell/assets/20356389/7d1b7e5f-17d0-41c8-8d2f-7896e0d73d66) ![image](https://github.com/nushell/nushell/assets/20356389/56917954-1231-43e7-bacf-e5760e263054) ![image](https://github.com/nushell/nushell/assets/20356389/630bcfc9-eb78-4a45-9c8f-97efc0c224f4) # User-Facing Changes `detect columns --guess` should not panic when receiving output from `winget list` at all anymore. A breaking change is the skipping of decoration lines, especially since scripts probably were doing something like `winget list | lines | reject 1 | str join "\n" | detect columns --guess`. This will now cause them to reject a line with valid data. # Tests + Formatting Added tests that exercise these edge cases, as well as a single-column test to make sure that trivial cases keep working. # After Submitting <!-- If your PR had any user-facing changes, update [the documentation](https://github.com/nushell/nushell.github.io) after the PR is merged, if necessary. This will help us keep the docs up to date. --> |
||
---|---|---|
.. | ||
nu-cli | ||
nu-cmd-base | ||
nu-cmd-extra | ||
nu-cmd-lang | ||
nu-cmd-plugin | ||
nu-color-config | ||
nu-command | ||
nu-derive-value | ||
nu-engine | ||
nu-explore | ||
nu-glob | ||
nu-json | ||
nu-lsp | ||
nu-parser | ||
nu-path | ||
nu-plugin | ||
nu-plugin-core | ||
nu-plugin-engine | ||
nu-plugin-protocol | ||
nu-plugin-test-support | ||
nu-pretty-hex | ||
nu-protocol | ||
nu-std | ||
nu-system | ||
nu-table | ||
nu-term-grid | ||
nu-test-support | ||
nu-utils | ||
nu_plugin_custom_values | ||
nu_plugin_example | ||
nu_plugin_formats | ||
nu_plugin_gstat | ||
nu_plugin_inc | ||
nu_plugin_nu_example | ||
nu_plugin_polars | ||
nu_plugin_python | ||
nu_plugin_query | ||
nu_plugin_stress_internals | ||
nuon | ||
README.md |
Nushell core libraries and plugins
These sub-crates form both the foundation for Nu and a set of plugins which extend Nu with additional functionality.
Foundational libraries are split into two kinds of crates:
- Core crates - those crates that work together to build the Nushell language engine
- Support crates - a set of crates that support the engine with additional features like JSON support, ANSI support, and more.
Plugins are likewise also split into two types:
- Core plugins - plugins that provide part of the default experience of Nu, including access to the system properties, processes, and web-connectivity features.
- Extra plugins - these plugins run a wide range of different capabilities like working with different file types, charting, viewing binary data, and more.