nushell / nushell Goto Github PK
View Code? Open in Web Editor NEWA new type of shell
Home Page: https://www.nushell.sh/
License: MIT License
A new type of shell
Home Page: https://www.nushell.sh/
License: MIT License
Can't pass additional args, eg cargo run -- --arg
Eg)
ps ax | grep telegram
This avoids needing to hardcode this sort of infrastructure in #33.
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.
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.
Use Cursive to pipe tables into a more interactive view
It'd be fun to be able to magic open up iCal and/or vCard files and get into the details
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.
With the new parser refactor, we lost the ability to say things like where size > 10KB
. We should try to add this back
We have open, but no way to save out the result to a file easily
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.
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
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:
Maybe ^ls
to run the system's ls
instead of the builtin
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.
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.
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 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.
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.
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
If you cd ..\otherdir
, we currently crash
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.
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))
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:
"Make the shell not crash"
ls *.jpg
)open my\ file.dat
)Note: there is also a follow-up MVP planned. Info available at #261
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.
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.
Some commands are working fine in Windows, but I'm seeing a few in Linux (or WSL) that aren't working correctly. Might be related to recent changes, I'm not sure.
Strawperson:
The external command produces a nu string for each line of stdout.
Pipes allow us to stream, but we should also detect errors being streamed and bail early so the user can do something about it.
There's a lot of duplication between enter and open, we should refactor
Fixed #134
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)
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
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
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
Can we cd into .zip and .dmg files? Or is there a way to enter them and step inside the mount?
I'm thinking https://github.com/jgallagher/rusqlite
We need a way of standing up nu, running a command, and diffing the output against the expected output.
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.
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.
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.
Are there any binary formats we want to magic-open?
Would be pretty cool to magic open .eml files and get into their contents
Like wc
. Takes a list of strings as $it
or a file as $it
.
Produces an object with these fields:
And any other useful facilities from wc
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.
TL;DR we already use subprocess
, and https://docs.rs/subprocess/0.1.18/subprocess/struct.Pipeline.html
Once we have #63, we need to enable CI support for at least Windows and Linux (and macOS if it differs noticeably from Linux)
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
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"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.