nushell/crates
Darren Schroeder 0805f1fd90
overhaul shell_integration to enable individual control over ansi escape sequences (#12629)
# Description

This PR overhauls the shell_integration system by allowing individual
control over which ansi escape sequences are used. As we continue to
broaden our support for more ansi escape sequences, we can't really have
an all-or-nothing strategy. Some ansi escapes cause problems in certain
operating systems or terminals. We should allow the user to choose which
escapes they want.

TODO:
* Gather feedback
* Should osc7, osc9_9 and osc633p be mutually exclusive?
* Is the naming convention for these settings too nerdy osc2, osc7, etc?

closes #11301

# User-Facing Changes
shell_integration is no longer a boolean value. This is what is
supported in the default_config.nu
```nushell
  shell_integration: {
    # osc2 abbreviates the path if in the home_dir, sets the tab/window title, shows the running command in the tab/window title
    osc2: true
    # osc7 is a way to communicate the path to the terminal, this is helpful for spawning new tabs in the same directory
    osc7: true
    # osc8 is also implemented as the deprecated setting ls.show_clickable_links, it shows clickable links in ls output if your terminal supports it
    osc8: true
    # osc9_9 is from ConEmu and is starting to get wider support. It's similar to osc7 in that it communicates the path to the terminal
    osc9_9: false
    # osc133 is several escapes invented by Final Term which include the supported ones below.
    # 133;A - Mark prompt start
    # 133;B - Mark prompt end
    # 133;C - Mark pre-execution
    # 133;D;exit - Mark execution finished with exit code
    # This is used to enable terminals to know where the prompt is, the command is, where the command finishes, and where the output of the command is
    osc133: true
    # osc633 is closely related to osc133 but only exists in visual studio code (vscode) and supports their shell integration features
    # 633;A - Mark prompt start
    # 633;B - Mark prompt end
    # 633;C - Mark pre-execution
    # 633;D;exit - Mark execution finished with exit code
    # 633;E - NOT IMPLEMENTED - Explicitly set the command line with an optional nonce
    # 633;P;Cwd=<path> - Mark the current working directory and communicate it to the terminal
    # and also helps with the run recent menu in vscode
    osc633: true
    # reset_application_mode is escape \x1b[?1l and was added to help ssh work better
    reset_application_mode: true
  }
```

# 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.
-->
2024-05-02 09:56:50 -04:00
..
nu_plugin_custom_values Bump version to 0.93.1 (#12710) 2024-05-01 17:19:20 -05:00
nu_plugin_example Bump version to 0.93.1 (#12710) 2024-05-01 17:19:20 -05:00
nu_plugin_formats Bump version to 0.93.1 (#12710) 2024-05-01 17:19:20 -05:00
nu_plugin_gstat Bump version to 0.93.1 (#12710) 2024-05-01 17:19:20 -05:00
nu_plugin_inc Bump version to 0.93.1 (#12710) 2024-05-01 17:19:20 -05:00
nu_plugin_nu_example Bump version to 0.93.1 (#12710) 2024-05-01 17:19:20 -05:00
nu_plugin_polars Bump version to 0.93.1 (#12710) 2024-05-01 17:19:20 -05:00
nu_plugin_python Bump version to 0.93.1 (#12710) 2024-05-01 17:19:20 -05:00
nu_plugin_query Bump version to 0.93.1 (#12710) 2024-05-01 17:19:20 -05:00
nu_plugin_stress_internals Bump version to 0.93.1 (#12710) 2024-05-01 17:19:20 -05:00
nu-cli overhaul shell_integration to enable individual control over ansi escape sequences (#12629) 2024-05-02 09:56:50 -04:00
nu-cmd-base Bump version to 0.93.1 (#12710) 2024-05-01 17:19:20 -05:00
nu-cmd-dataframe Bump version to 0.93.1 (#12710) 2024-05-01 17:19:20 -05:00
nu-cmd-extra Bump version to 0.93.1 (#12710) 2024-05-01 17:19:20 -05:00
nu-cmd-lang Bump version to 0.93.1 (#12710) 2024-05-01 17:19:20 -05:00
nu-cmd-plugin Bump version to 0.93.1 (#12710) 2024-05-01 17:19:20 -05:00
nu-color-config add raw-string literal support (#9956) 2024-05-02 09:36:37 -04:00
nu-command overhaul shell_integration to enable individual control over ansi escape sequences (#12629) 2024-05-02 09:56:50 -04:00
nu-engine Change environment variables to be case-preserving (#12701) 2024-05-01 17:22:34 -05:00
nu-explore explore: adopt anyhow, support CustomValue, remove help system (#12692) 2024-05-01 17:34:37 -05:00
nu-glob Bump version to 0.93.1 (#12710) 2024-05-01 17:19:20 -05:00
nu-json Bump version to 0.93.1 (#12710) 2024-05-01 17:19:20 -05:00
nu-lsp Bump version to 0.93.1 (#12710) 2024-05-01 17:19:20 -05:00
nu-parser add raw-string literal support (#9956) 2024-05-02 09:36:37 -04:00
nu-path Path expansion no longer removes trailing slashes (#12662) 2024-05-01 17:28:54 -05:00
nu-plugin Bump version to 0.93.1 (#12710) 2024-05-01 17:19:20 -05:00
nu-plugin-core Bump version to 0.93.1 (#12710) 2024-05-01 17:19:20 -05:00
nu-plugin-engine Bump version to 0.93.1 (#12710) 2024-05-01 17:19:20 -05:00
nu-plugin-protocol Bump version to 0.93.1 (#12710) 2024-05-01 17:19:20 -05:00
nu-plugin-test-support Bump version to 0.93.1 (#12710) 2024-05-01 17:19:20 -05:00
nu-pretty-hex Bump version to 0.93.1 (#12710) 2024-05-01 17:19:20 -05:00
nu-protocol overhaul shell_integration to enable individual control over ansi escape sequences (#12629) 2024-05-02 09:56:50 -04:00
nu-std Bump version to 0.93.1 (#12710) 2024-05-01 17:19:20 -05:00
nu-system Bump version to 0.93.1 (#12710) 2024-05-01 17:19:20 -05:00
nu-table Bump version to 0.93.1 (#12710) 2024-05-01 17:19:20 -05:00
nu-term-grid Bump version to 0.93.1 (#12710) 2024-05-01 17:19:20 -05:00
nu-test-support Bump version to 0.93.1 (#12710) 2024-05-01 17:19:20 -05:00
nu-utils overhaul shell_integration to enable individual control over ansi escape sequences (#12629) 2024-05-02 09:56:50 -04:00
nuon add raw-string literal support (#9956) 2024-05-02 09:36:37 -04:00
README.md Remove old nushell/merge engine-q 2022-02-07 14:54:06 -05:00

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.