nushell/crates
Andy Gayton 1cd0544a3f
fix: relay Signals reset to plugins (#13510)
This PR will close #13501

# Description

This PR expands on [the relay of signals to running plugin
processes](https://github.com/nushell/nushell/pull/13181). The Ctrlc
relay has been generalized to SignalAction::Interrupt and when
reset_signal is called on the main EngineState, a SignalAction::Reset is
now relayed to running plugins.

# User-Facing Changes

The signal handler closure now takes a `signals::SignalAction`, while
previously it took no arguments. The handler will now be called on both
interrupt and reset. The method to register a handler on the plugin side
is now called `register_signal_handler` instead of
`register_ctrlc_handler`
[example](https://github.com/nushell/nushell/pull/13510/files#diff-3e04dff88fd0780a49778a3d1eede092ec729a1264b4ef07ca0d2baa859dad05L38).
This will only affect plugin authors who have started making use of
https://github.com/nushell/nushell/pull/13181, which isn't currently
part of an official release.

The change will also require all of user's plugins to be recompiled in
order that they don't error when a signal is received on the
PluginInterface.

# Testing

```
: example ctrlc
interrupt status: false
waiting for interrupt signal...
^Cinterrupt status: true
peace.
Error:   × Operation interrupted
   ╭─[display_output hook:1:1]
 1 │ if (term size).columns >= 100 { table -e } else { table }
   · ─┬
   ·  ╰── This operation was interrupted
   ╰────

: example ctrlc
interrupt status: false   <-- NOTE status is false
waiting for interrupt signal...
^Cinterrupt status: true
peace.
Error:   × Operation interrupted
   ╭─[display_output hook:1:1]
 1 │ if (term size).columns >= 100 { table -e } else { table }
   · ─┬
   ·  ╰── This operation was interrupted
   ╰────
   ```
2024-08-06 03:35:40 -07:00
..
nu_plugin_custom_values Bump version to 0.96.2 (#13485) 2024-07-29 17:20:55 -07:00
nu_plugin_example fix: relay Signals reset to plugins (#13510) 2024-08-06 03:35:40 -07:00
nu_plugin_formats Adding plist support (#13545) 2024-08-05 14:07:15 -07:00
nu_plugin_gstat Bump version to 0.96.2 (#13485) 2024-07-29 17:20:55 -07:00
nu_plugin_inc Bump version to 0.96.2 (#13485) 2024-07-29 17:20:55 -07:00
nu_plugin_nu_example Make pipeline metadata available to plugins (#13495) 2024-08-02 11:01:20 -07:00
nu_plugin_polars Add "--as-columns" flag to polars into-df (#13449) 2024-07-30 08:50:50 -05:00
nu_plugin_python Make pipeline metadata available to plugins (#13495) 2024-08-02 11:01:20 -07:00
nu_plugin_query Include empty table data cells in query web tables (#13538) 2024-08-05 06:20:14 -05:00
nu_plugin_stress_internals Make pipeline metadata available to plugins (#13495) 2024-08-02 11:01:20 -07:00
nu-cli Add completions.sort option (#13311) 2024-08-05 20:30:10 -04:00
nu-cmd-base Path migration part 3: $nu paths (#13368) 2024-08-01 10:16:31 +02:00
nu-cmd-extra Bump version to 0.96.2 (#13485) 2024-07-29 17:20:55 -07:00
nu-cmd-lang setting content type metadata on all core to * commands (#13506) 2024-08-01 11:10:52 +02:00
nu-cmd-plugin Bump version to 0.96.2 (#13485) 2024-07-29 17:20:55 -07:00
nu-color-config Bump version to 0.96.2 (#13485) 2024-07-29 17:20:55 -07:00
nu-command Attempt to guess the content type of a file when opening with --raw (#13521) 2024-08-06 11:36:24 +02:00
nu-derive-value Bump version to 0.96.2 (#13485) 2024-07-29 17:20:55 -07:00
nu-engine Rework help generation internals (#13531) 2024-08-05 22:44:24 +02:00
nu-explore Bump version to 0.96.2 (#13485) 2024-07-29 17:20:55 -07:00
nu-glob Bump version to 0.96.2 (#13485) 2024-07-29 17:20:55 -07:00
nu-json Bump version to 0.96.2 (#13485) 2024-07-29 17:20:55 -07:00
nu-lsp Add completions.sort option (#13311) 2024-08-05 20:30:10 -04:00
nu-parser Contentious clippy fixes (#13498) 2024-08-01 11:02:55 +02:00
nu-path Path migration part 3: $nu paths (#13368) 2024-08-01 10:16:31 +02:00
nu-plugin fix: relay Signals reset to plugins (#13510) 2024-08-06 03:35:40 -07:00
nu-plugin-core Make pipeline metadata available to plugins (#13495) 2024-08-02 11:01:20 -07:00
nu-plugin-engine fix: relay Signals reset to plugins (#13510) 2024-08-06 03:35:40 -07:00
nu-plugin-protocol fix: relay Signals reset to plugins (#13510) 2024-08-06 03:35:40 -07:00
nu-plugin-test-support Bump similar from 2.5.0 to 2.6.0 (#13492) 2024-07-31 08:10:33 +00:00
nu-pretty-hex Clippy fixes from stable and nightly (#13455) 2024-07-31 20:37:40 +02:00
nu-protocol fix: relay Signals reset to plugins (#13510) 2024-08-06 03:35:40 -07:00
nu-std fix: Make log respect use_ansi_coloring setting. (#13442) 2024-07-30 08:34:11 -05:00
nu-system Clippy fixes from stable and nightly (#13455) 2024-07-31 20:37:40 +02:00
nu-table Bump version to 0.96.2 (#13485) 2024-07-29 17:20:55 -07:00
nu-term-grid Bump version to 0.96.2 (#13485) 2024-07-29 17:20:55 -07:00
nu-test-support Attempt to guess the content type of a file when opening with --raw (#13521) 2024-08-06 11:36:24 +02:00
nu-utils Add completions.sort option (#13311) 2024-08-05 20:30:10 -04:00
nuon Clippy fixes from stable and nightly (#13455) 2024-07-31 20:37:40 +02: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.