nushell/crates
Steven 2264682443
fix shell integration markers (#11352)
<!--
if this PR closes one or more issues, you can automatically link the PR
with
them by using one of the [*linking
keywords*](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword),
e.g.
- this PR should close #xxxx
- fixes #xxxx

you can also mention related issues, PRs or discussions!
-->
Fixes #11260 

# Description
<!--
Thank you for improving Nushell. Please, check our [contributing
guide](../CONTRIBUTING.md) and talk to the core team before making major
changes.

Description of your pull request goes here. **Provide examples and/or
screenshots** if your changes affect the user experience.
-->
Note: my issue description was a bit wrong. Issue one can't be
reproduced without a config (`shell_integration` isn't on by default,
so..), however the issue itself is still valid

For issue 1, the default prompt needs to know about the
`shell_integration` config, and the markers are added around the default
prompt when that's on.

For issue 2, this is actually related to transient prompts. When
rendering, the markers weren't added like for normal prompts.

After the fix the output do now contain the proper markers:

Reproducing the minimum config here for convenience:

```nu
$env.config = {
    show_banner: false
    shell_integration: true
}
# $env.PROMPT_COMMAND = {|| "> " }
```

For issue 1, the output looks like: 
```
[2.3490236,"o","\u001b[?25l\u001b[21;1H\u001b[21;1H\u001b[J\u001b[38;5;10m\u001b]133;A\u001b\\/home/steven\u001b]133;B\u001b\\\u001b[38;5;14m\u001b[38;5;5m\u001b7\u001b[21;84H12/16/2023 03:31:58 PM\u001b8\u001b[0m\u001b[0m\u001b[1;36mecho\u001b[0m\u001b7\u001b8\u001b[?25h"]
[2.5676293,"o","\u001b[6n"]
[2.571353,"o","\u001b[?25l\u001b[21;1H\u001b[21;1H\u001b[J\u001b[38;5;10m\u001b]133;A\u001b\\\u001b]133;A\u001b\\/home/steven\u001b]133;B\u001b\\\u001b]133;B\u001b\\\u001b[38;5;14m\u001b[38;5;5m\u001b7\u001b[21;84H12/16/2023 03:31:59 PM\u001b8\u001b[0m\u001b[0m\u001b[1;36mecho\u001b[0m\u001b7\u001b8\u001b[?25h\u001b[21;1H\r\n\u001b[21;1H"]
[2.571436,"o","\u001b[?2004l"]
[2.5714657,"o","\u001b]133;C\u001b\\"]
```
in line 3, where enter is pressed, `133 A` and `B` are present.

Same for issue 2 (uncomment the `PROMPT_COMMAND` line in the config):
```
[1.9585224,"o","\u001b[?25l\u001b[21;1H\u001b[21;1H\u001b[J\u001b[38;5;10m\u001b]133;A\u001b\\> \u001b]133;B\u001b\\\u001b[38;5;14m\u001b[38;5;5m\u001b7\u001b[21;84H12/16/2023 03:32:15 PM\u001b8\u001b[0m\u001b[0m\u001b[1;36mecho\u001b[0m\u001b7\u001b8\u001b[?25h"]
[2.453972,"o","\u001b[6n"]
[2.4585786,"o","\u001b[?25l\u001b[21;1H\u001b[21;1H\u001b[J\u001b[38;5;10m\u001b]133;A\u001b\\\u001b]133;A\u001b\\> \u001b]133;B\u001b\\\u001b]133;B\u001b\\\u001b[38;5;14m\u001b[38;5;5m\u001b7\u001b[21;84H12/16/2023 03:32:15 PM\u001b8\u001b[0m\u001b[0m\u001b[1;36mecho\u001b[0m\u001b7\u001b8\u001b[?25h\u001b[21;1H\r\n\u001b[21;1H\u001b[?2004l\u001b]133;C\u001b\\\r\n\u001b]133;D;0\u001b\\\u001b]7;file://Aostro-5468/home/steven\u001b\\\u001b]2;~\u0007\u001b[?1l"]
[2.4669976,"o","\u001b[?2004h\u001b[6n"]
[2.4703515,"o","\u001b[6n"]
[2.4736586,"o","\u001b[?25l\u001b[21;1H\u001b[21;1H\u001b[J\u001b[38;5;10m\u001b]133;A\u001b\\> \u001b]133;B\u001b\\\u001b[38;5;14m\u001b[38;5;5m\u001b7\u001b[21;84H12/16/2023 03:32:15 PM\u001b8\u001b[0m\u001b[0m\u001b7\u001b8\u001b[?25h"]
```

# User-Facing Changes
<!-- List of all changes that impact the user experience here. This
helps us keep track of breaking changes. -->

None user facing changes other than that prompt markers are working

# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to
check that you're using the standard code style
- `cargo test --workspace` to check that all tests pass (on Windows make
sure to [enable developer
mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging))
- `cargo run -- -c "use std testing; testing run-tests --path
crates/nu-std"` to run the tests for the standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->

# 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.
-->
2023-12-16 20:12:34 -06:00
..
nu-cli fix shell integration markers (#11352) 2023-12-16 20:12:34 -06:00
nu-cmd-base Bump version to 0.88.2 (#11333) 2023-12-14 13:55:48 -06:00
nu-cmd-dataframe Polars Struct support without unsafe blocks (#11229) 2023-12-15 11:21:30 +01:00
nu-cmd-extra Bump version to 0.88.2 (#11333) 2023-12-14 13:55:48 -06:00
nu-cmd-lang Enforce required, optional, and rest positional arguments start with an uppercase and end with a period. (#11285) 2023-12-15 14:32:37 +08:00
nu-color-config Bump version to 0.88.2 (#11333) 2023-12-14 13:55:48 -06:00
nu-command Allow filesize type as a valid limit value (#11349) 2023-12-16 09:56:03 -06:00
nu-engine Bump version to 0.88.2 (#11333) 2023-12-14 13:55:48 -06:00
nu-explore Bump version to 0.88.2 (#11333) 2023-12-14 13:55:48 -06:00
nu-glob Bump version to 0.88.2 (#11333) 2023-12-14 13:55:48 -06:00
nu-json Bump version to 0.88.2 (#11333) 2023-12-14 13:55:48 -06:00
nu-lsp Make hover equal to help command (#11320) 2023-12-15 11:39:19 -06:00
nu-parser disable directory submodule auto export (#11157) 2023-12-15 12:37:55 +01:00
nu-path Bump version to 0.88.2 (#11333) 2023-12-14 13:55:48 -06:00
nu-plugin Bump version to 0.88.2 (#11333) 2023-12-14 13:55:48 -06:00
nu-pretty-hex Bump version to 0.88.2 (#11333) 2023-12-14 13:55:48 -06:00
nu-protocol Move history into their own module (#11308) 2023-12-15 13:17:12 +01:00
nu-std disable directory submodule auto export (#11157) 2023-12-15 12:37:55 +01:00
nu-system Bump version to 0.88.2 (#11333) 2023-12-14 13:55:48 -06:00
nu-table Bump version to 0.88.2 (#11333) 2023-12-14 13:55:48 -06:00
nu-term-grid Bump version to 0.88.2 (#11333) 2023-12-14 13:55:48 -06:00
nu-test-support Bump version to 0.88.2 (#11333) 2023-12-14 13:55:48 -06:00
nu-utils Bump version to 0.88.2 (#11333) 2023-12-14 13:55:48 -06:00
nu_plugin_custom_values Bump version to 0.88.2 (#11333) 2023-12-14 13:55:48 -06:00
nu_plugin_example Bump version to 0.88.2 (#11333) 2023-12-14 13:55:48 -06:00
nu_plugin_formats Bump version to 0.88.2 (#11333) 2023-12-14 13:55:48 -06:00
nu_plugin_gstat Bump version to 0.88.2 (#11333) 2023-12-14 13:55:48 -06:00
nu_plugin_inc Bump version to 0.88.2 (#11333) 2023-12-14 13:55:48 -06:00
nu_plugin_python remove vectorize_over_list from python plugin (#9905) 2023-08-03 16:46:48 +02:00
nu_plugin_query Bump version to 0.88.2 (#11333) 2023-12-14 13:55:48 -06:00
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.