Skip to content

Instantly share code, notes, and snippets.

@devyn
Last active April 27, 2024 12:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devyn/e9bad3d60fd980d9e24c1772b1026285 to your computer and use it in GitHub Desktop.
Save devyn/e9bad3d60fd980d9e24c1772b1026285 to your computer and use it in GitHub Desktop.
Nushell TODOs

@devyn's nushell TODOs

Commands

  • Improve error record in try/catch and document with an example
    • Adding the code would be helpful
  • Add closure argument to append, prepend for adding another stream
  • run for running nushell scripts as if they were blocks
  • Make http commands accept and stream from pipeline input
  • nice for low thread priority? (would be nice on windows for sure)
  • Make from json --objects stream the input, maybe don't require line delimited input either.
  • debug should probably not behave differently for lists/ranges
  • items --as-record for making a record again?
  • to raw for making raw input
    • str join --stream
    • bytes collect --stream
  • run-external weird buffering behavior, maybe don't do line buffering since we have lines
  • allow bytes at to transform stream
  • bytes build accept more input arguments (byte numbers?), or use a different command like byte N

Core

  • Modify copy-on-write PR to not have DerefMut, use to_mut() instead
  • String overhaul - new NuString type, with possibly shared strings
    • Submit? only a performance regression at this point though
  • Derive macros & traits for converting structured Rust data to/from Values
    • Make it usable for Config too (UpdateFromValue)
  • Command line option for nu to print without newline (for use in editors)
  • Custom values: convert_to(Type) for better conversion support
    • use for into * commands
  • Create iterator type for streams with more reliable interrupt
  • Add config dir option and have tests use a temp config dir with the default config
  • Make $in usable in pipelines later than the first one
  • impl Read for RawStream (already did this more or less for from msgpack)

Plugin support

  • Make context drop more explicit, so plugins can hold on to context if they want to
    • Call response flag (keep_context?) - that way we don't have to clone context unless asked to
    • DropContext message when done, if kept
  • Allow plugins to get a Ctrl-C signal from the engine somehow
  • Use custom_value_to_base_value on examples
  • View span source (as a way of making dfr ls nice)
    • ... on just the literal text covered by the span
    • ... the line(s) the span covers, including line numbers/filename
  • Plugin user experience improvements:
    • Proposal: https://hackmd.io/@nucore/SJW9Cd_gR
    • Break register up into separate commands
      • plugin add
      • plugin rm
      • plugin use (pending PR)
    • Plugin msgpackz file, instead of plugin.nu
    • Make loading cached signatures from the plugin file tolerant of deserialization errors
    • @fdncred request: support filenames in all of the plugin commands, for consistency
  • Support named pipes (FIFO, unix socket, Windows named pipe?) instead of stdin/stdout, so that TUI is easier
    • @amtoine's nu_plugin_explore stopped working, so try to fix that
  • Handle panics during plugin commands
  • Get rid of untagged in plugin input/output, replace with explicitly including the stream items, for better serde errors
  • Split the plugin crate
    • Discuss at team meeting (2024-03-27)
    • Implement after release of 0.92.0
    • Pending PR

Plugins

  • Start on nu_plugin_portal
  • Plugin library for creating handle custom values
  • Scala library for plugins?

Refactor

  • PluginExecutionBogusContext - use macros to implement unimplemented items with less boilerplate
  • FromValue - clean up Spanned / non-spanned impls by just using the Spanned impl and discarding the span

Misc. bugs

  • Figure out why my config causes panics on debug, but not on release
    • this seems to have been resolved, but I'm not sure when
  • Fix nushell/nushell#10707 - command names in 'help' being always based on definition name rather than name in scope
  • Fix test bug commands::def::def_wrapped_wrong_rest_type_error when terminal too narrow, fails to match help text
  • Windows glob requires forward slash path separator?

Docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment