Skip to content

Instantly share code, notes, and snippets.

@devyn
Last active June 26, 2024 21:08
Show Gist options
  • 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

  • Remove register
  • 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
  • collect without closure arg
  • Make commands more reliably use bytestreams https://hackmd.io/4lHUs6Q3Q9iu7wek2xlSdw

Core

  • 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)
    • Piepmatz is working on this, yay!
  • 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)
  • Typed ByteStreams (bytestream-streaming-commands) (WIP)

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
  • 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
  • Don't follow links on plugin add (affects Homebrew, nix)

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

  • 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