Nushell core team meeting 2024-05-08

Attendees

  • Darren
  • Devyn
  • Michael
  • Andy
  • Jakub
  • Filip
  • Wind
  • Stefan
  • Woossaaahh
  • Antoine
  • Ian
  • Jack

Agenda

Discussed Topics

--not on str contains

  • Jakub: should not add --not flag to every command that returns a bool
    • challenge to keep consistent and would escalate
  • Darren not (check) is a bit wordy
  • Devyn: is-not-empty is one of the frequently used cases where the ceremony would be annoying
  • not is an operator so it can't really act like a regular command
  • | not $in should work already (thx Ian for pointing this out)
  • | not would be slightly more elegant (would require some parser hacking because not is an operator)

redirection of string(stream) like POSIX stream to file

Should we reserve out> for externals only?

  • We kind of have out> doing multiple things potentially, going from a string stream to a file would be very straightforward, but print doesn't produce a string stream
  • Darren: don't want to forbid redirecting external streams, more inconsistency not great
  • Side-challenge: missing err>null and err> /dev/null is not cross-platform
  • out> file is faster for externals because the OS can do it
  • maybe we're not going to resolve this today
  • should we do a poll?
  • kubouch: only o> and o>> should work for nushell internal values, o>| is a noop = |
  • kubouch: manual wrappers around external commands how would this play with redirect?
    • file redirections create a scope, all external commands inside the expression use the file redirection
  • Wind: User expecting echo "aaa" o> file.txt
  • we will create one inconsistency anyways > try to find the minimal pain, easiest to explain way
  • Jack: o+e> would break if we disallow values and you may encounter a situation where there is an external emitting STDERR in your previous pipeline step.
    • error stream could be a future think to talk about
  • Conclusion for #12785: improve the error message, try out, gather user feedback

Separate track print and internal eprintln!s

  • We can't support things like print err> or print out> already, so it's important that people understand the difference
  • Since we now know what the redirection state (OutDest) is from the Stack, it's actually possible for print to support this. Maybe we can be consistent
  • more thought/analysis needed (out of scope for now)

Stream refactor

  • Ian working on ByteStream, which replaces ExternalStream with a generalized single stream type that can be more easily used by internal commands too
  • PR: https://github.com/nushell/nushell/pull/12774
  • exit code changes have been factored out (would have been a breaking change)
  • Devyn already on top building a type-flavour:
    • mark if it is a utf-8 stream or unknown encoding and internals can also enforce binary
      • Unknown (from external)
      • String (all operations can be sure about utf-8 encoding)
      • Binary (explicit will show hexdump)
    • plus adding this to some internal commands already

MIME type commands

Select a repo