Giter Site home page Giter Site logo

nushell / nushell Goto Github PK

View Code? Open in Web Editor NEW
30.1K 30.1K 1.6K 43.13 MB

A new type of shell

Home Page: https://www.nushell.sh/

License: MIT License

Rust 97.88% Shell 0.04% Python 0.08% Batchfile 0.01% PowerShell 0.01% Dockerfile 0.01% Nushell 1.96%
rust shell

nushell's Issues

Improvements to 'open'

Open/from/to for each file type should be registered in a central place so that in the future plugins have access to the registry.

Confirmation infrastructure

Like -WhatIf and -Force in PowerShell.

We should do better than PS at getting arbitrary commands to support confirmation.

Idea from @jonathandturner: what if dangerous behavior like removing files could only be accomplished by returning actions from commands, which would then be handled by the host?

@wycats likes it.

Add iCal/vCard support

It'd be fun to be able to magic open up iCal and/or vCard files and get into the details

rm

Basic spec:

function rm($file)
OR
function rm($it)

$file may be an absolute or relative path or a file object. $it may only be a file object.

If $file is a relative path, it's interpreted relative to the current cwd.

If the file to delete is a directory, it behaves like rm -rf in Linux or rm -Recurse -Force in PowerShell. The user must have permissions to delete the relevant files.

If the file to delete is a file, it behaves like rm. The user must have permissions to delete the relevant file.

Open Question: Should rm on a directory confirm? If so, how does it relate to #16.

Add back size numbers

With the new parser refactor, we lost the ability to say things like where size > 10KB. We should try to add this back

Parse boolean values

Would be nice to be able to do pass commands like where yanked != true though it currently seems that true is being parsed as a string.

Ctrl-C should break running app

Right now, ctrl-C will close nu altogether, rather than breaking the running app. Would be nice to just break the app and get back to the nu shell

Type check commands

We have enough information about the commands and the piped chain of commands that we could do some simple typechecking on it before we run it.

Some examples:

  • Commands that expect objects need objects to flow in
  • Commands that expect strings can't have objects flow in
  • External commands that use $it expect strings

Partial evaluation like xargs

Straw man:

ps | where name =~ chrome | kill $it.pid

TL;DR, when a statement refers to $it, it effectively desugars into a closure taking one parameter whose value is the current pipeline input.

Support $PATH

On Windows, you can lean on the Windows system for invoking applications, but you need some path support in Linux if you want to use this as your shell.

Note: this may be from us using the default shelling, which runs sh, and may not have access to the additional directories that bash makes visible to the path.

Scanf equivalent command

Rather than only having split-column, it'd be nice to have a scan-column that can do a split but based on a pattern.

Eg) rg -n None | split-row "\n" | scan "<Filename>: <Line>: <Extra>"

open <url> doesn't support binary

open may be opening a url pointing to a binary file. We should extend the MIME support to detect this as best we can, so that we get a Value::Binary instead of String.

Autocomplete needs smarter 'cd'

Currently, history appears to pop up when typing 'cd', but this will show the directory you just cd'ed into rather than helping you pick the next directory to 'cd' to.

Name of command to edit cell

Our view of table data is read-only, but as we think about round-tripping with load/save, it would be helpful to be able to edit cells easily

Field groups

To make it possible to quickly select a bunch of common fields without having to enumerate them every time.

This can also be used to describe the default group of fields used in a table.

Track down possible rustyline issue

Not sure if this is rustyline, so I don't want to point fingers, but I am seeing nu fail on rare occasion on start with:

Error: Io(Kind(InvalidData))

MVP #1 - "Hey it works"

"Hey, it works"

While there are a lot of areas nu can grow, this is the list to get to the point we can demonstrate all the core philosophy and functionality:

Requirements for loadable plugins

  • full-fidelity Value serialization
  • plugin metadata

Requirements for for-each/$it

  • evaluating 'static' and 'per-value' commands

Requirements for basic shell functionality

  • Basic file operations (#207)
    • cp
    • rm
    • mv
    • mkdir
    • (others?)
  • Escape valve to system binaries (#25)

Reliability (#294)

"Make the shell not crash"

  • Fix list viewing (currently it seems like values just disappear)

Essentials and nice-to-haves

  • a means to edit objects
  • working with globs (eg ls *.jpg)
  • space in file names (eg open my\ file.dat)
  • a better 'view'
  • a rotated table view that makes it easier to view tables with many columns
  • optional row numbers

Polish

  • Complete docs

Note: there is also a follow-up MVP planned. Info available at #261

Store history.txt in central location

Right now, it's possible for history.txt to appear in different parts of the file system depending on when and where you use nu. Would be nice if this history was part of config, or generally lived in a central location.

Get rid of unwraps in commands

We've got better error handling now, but there are still plenty of unwraps in our commands. We can convert these to use the error reporting system instead.

Non-primitive cast error

While building:

error[E0605]: non-primitive cast: `sysinfo::linux::process::ProcessStatus` as `i64`
  --> src/object/process.rs:20:35
   |
20 |     dict.add("status", Value::int(proc.status() as i64));
   |                                   ^^^^^^^^^^^^^^^^^^^^
   |
   = note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait

error: aborting due to previous error

For more information about this error, try `rustc --explain E0605`.
error: Could not compile `nu`.

I'm running rustc 1.36.0-nightly (7158ed9cb 2019-05-15)

Per directory $env

Might be interesting to explore what it would be like to be able to craft your environment specific to a given directory, effectively letting directories have their own env

Split

Now that we have external->nu, it'd be great to take in a stream and split the lines as they come in to create columns

`which`

Should be able to handle builtins. I think something like the where.exe approach is nice here -- a list of all of the results and if you want the top you do | first 1

Tests

We need a way of standing up nu, running a command, and diffing the output against the expected output.

General cleanup of error reporting

Along with #65, we should have a more general cleanup of how we're handling errors and uniformally use the error value.

As part of this, also get rid of unwraps, and flow errors out without crashing.

open and view can't take $it

It would be great if $it (and $it with path) was universal, and we could use it on any commands. Currently, it seems to be a mixed bag whether or not the command supports it.

License

Just noticed we're currently ISC. Not sure exactly what that is. We might want to switch to something more Rust-y at some point.

size

Like wc. Takes a list of strings as $it or a file as $it.

Produces an object with these fields:

  • bytes
  • lines
  • words (maybe)
  • max-length

And any other useful facilities from wc

Pipeline should be streaming

Right now, each nu->nu pipeline collects all the results before moving to the next step. Ideally, all pipelines would be streaming so we could seamlessly integrate with external commands and also handle commands with large amounts of data.

CI for PRs

Once we have #63, we need to enable CI support for at least Windows and Linux (and macOS if it differs noticeably from Linux)

Use '?' to switch into help mode

From the Julia CLI:

If you type ? first, the prompt switches to help?> to let you know you can now ask about questions rather than run them. Great idea

ls should use 'name' and 'type'

To align with the other columns, and to generally be easier to type, we might want to go with 'name' and 'size' instead of "file name" and "file size"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.