A new type of shell

Overview

README

Crates.io Build Status Discord The Changelog #363 @nu_shell GitHub commit activity GitHub contributors

Nushell

A new type of shell.

Example of nushell

Status

This project has reached a minimum-viable product level of quality. While contributors dogfood it as their daily driver, it may be unstable for some commands. Future releases will work to fill out missing features and improve stability. Its design is also subject to change as it matures.

Nu comes with a set of built-in commands (listed below). If a command is unknown, the command will shell-out and execute it (using cmd on Windows or bash on Linux and macOS), correctly passing through stdin, stdout, and stderr, so things like your daily git workflows and even vim will work just fine.

Learning more

There are a few good resources to learn about Nu. There is a book about Nu that is currently in progress. The book focuses on using Nu and its core concepts.

If you're a developer who would like to contribute to Nu, we're also working on a book for developers to help you get started. There are also good first issues to help you dive in.

We also have an active Discord and Twitter if you'd like to come and chat with us.

You can also find information on more specific topics in our cookbook.

Try it in Gitpod.

Open in Gitpod

Installation

Local

Up-to-date installation instructions can be found in the installation chapter of the book. Windows users: please note that Nu works on Windows 10 and does not currently have Windows 7/8.1 support.

To build Nu, you will need to use the latest stable (1.47 or later) version of the compiler.

Required dependencies:

  • pkg-config and libssl (only needed on Linux)
    • On Debian/Ubuntu: apt install pkg-config libssl-dev

Optional dependencies:

  • To use Nu with all possible optional features enabled, you'll also need the following:
    • On Linux (on Debian/Ubuntu): apt install libxcb-composite0-dev libx11-dev

To install Nu via cargo (make sure you have installed rustup and the latest stable compiler via rustup install stable):

cargo install nu

You can also build Nu yourself with all the bells and whistles (be sure to have installed the dependencies for your platform), once you have checked out this repo with git:

cargo build --workspace --features=extra

Docker

Quickstart

Want to try Nu right away? Execute the following to get started.

docker run -it quay.io/nushell/nu:latest

Guide

If you want to pull a pre-built container, you can browse tags for the nushell organization on Quay.io. Pulling a container would come down to:

docker pull quay.io/nushell/nu
docker pull quay.io/nushell/nu-base

Both "nu-base" and "nu" provide the nu binary, however nu-base also includes the source code at /code in the container and all dependencies.

Optionally, you can also build the containers locally using the dockerfiles provided: To build the base image:

docker build -f docker/Dockerfile.nu-base -t nushell/nu-base .

And then to build the smaller container (using a Multistage build):

docker build -f docker/Dockerfile -t nushell/nu .

Either way, you can run either container as follows:

docker run -it nushell/nu-base
docker run -it nushell/nu
/> exit

The second container is a bit smaller if the size is important to you.

Packaging status

Packaging status

Fedora

COPR repo: sudo dnf copr enable atim/nushell -y && sudo dnf install nushell -y

Philosophy

Nu draws inspiration from projects like PowerShell, functional programming languages, and modern CLI tools. Rather than thinking of files and services as raw streams of text, Nu looks at each input as something with structure. For example, when you list the contents of a directory, what you get back is a table of rows, where each row represents an item in that directory. These values can be piped through a series of steps, in a series of commands called a 'pipeline'.

Pipelines

In Unix, it's common to pipe between commands to split up a sophisticated command over multiple steps. Nu takes this a step further and builds heavily on the idea of pipelines. Just as the Unix philosophy, Nu allows commands to output from stdout and read from stdin. Additionally, commands can output structured data (you can think of this as a third kind of stream). Commands that work in the pipeline fit into one of three categories:

  • Commands that produce a stream (eg, ls)
  • Commands that filter a stream (eg, where type == "Dir")
  • Commands that consume the output of the pipeline (eg, autoview)

Commands are separated by the pipe symbol (|) to denote a pipeline flowing left to right.

> ls | where type == "Dir" | autoview
───┬────────┬──────┬───────┬──────────────
 # │ name   │ type │ size  │ modified
───┼────────┼──────┼───────┼──────────────
 0 │ assets │ Dir  │ 128 B │ 5 months ago
 1 │ crates │ Dir  │ 704 B │ 50 mins ago
 2 │ debian │ Dir  │ 352 B │ 5 months ago
 3 │ docker │ Dir  │ 288 B │ 3 months ago
 4 │ docs   │ Dir  │ 192 B │ 50 mins ago
 5 │ images │ Dir  │ 160 B │ 5 months ago
 6 │ src    │ Dir  │ 128 B │ 1 day ago
 7 │ target │ Dir  │ 160 B │ 5 days ago
 8 │ tests  │ Dir  │ 192 B │ 3 months ago
───┴────────┴──────┴───────┴──────────────

Because most of the time you'll want to see the output of a pipeline, autoview is assumed. We could have also written the above:

> ls | where type == Dir

Being able to use the same commands and compose them differently is an important philosophy in Nu. For example, we could use the built-in ps command as well to get a list of the running processes, using the same where as above.

> ps | where cpu > 0
───┬────────┬───────────────────┬──────────┬─────────┬──────────┬──────────
 # │ pid    │ name              │ status   │ cpu     │ mem      │ virtual
───┼────────┼───────────────────┼──────────┼─────────┼──────────┼──────────
 0 │    435 │ irq/142-SYNA327   │ Sleeping │  7.5699 │      0 B │      0 B
 1 │   1609 │ pulseaudio        │ Sleeping │  6.5605 │  10.6 MB │   2.3 GB
 2 │   1625 │ gnome-shell       │ Sleeping │  6.5684 │ 639.6 MB │   7.3 GB
 3 │   2202 │ Web Content       │ Sleeping │  6.8157 │ 320.8 MB │   3.0 GB
 4 │ 328788 │ nu_plugin_core_ps │ Sleeping │ 92.5750 │   5.9 MB │ 633.2 MB
───┴────────┴───────────────────┴──────────┴─────────┴──────────┴──────────

Opening files

Nu can load file and URL contents as raw text or as structured data (if it recognizes the format). For example, you can load a .toml file as structured data and explore it:

> open Cargo.toml
────────────────────┬───────────────────────────
 bin                │ [table 18 rows]
 build-dependencies │ [row serde toml]
 dependencies       │ [row 29 columns]
 dev-dependencies   │ [row nu-test-support]
 features           │ [row 19 columns]
 package            │ [row 12 columns]
 workspace          │ [row members]
────────────────────┴───────────────────────────

We can pipeline this into a command that gets the contents of one of the columns:

> open Cargo.toml | get package
───────────────┬────────────────────────────────────
 authors       │ [table 1 rows]
 default-run   │ nu
 description   │ A new type of shell
 documentation │ https://www.nushell.sh/book/
 edition       │ 2018
 exclude       │ [table 1 rows]
 homepage      │ https://www.nushell.sh
 license       │ MIT
 name          │ nu
 readme        │ README.md
 repository    │ https://github.com/nushell/nushell
 version       │ 0.21.0
───────────────┴────────────────────────────────────

Finally, we can use commands outside of Nu once we have the data we want:

> open Cargo.toml | get package.version
0.21.0

Here we use the variable $it to refer to the value being piped to the external command.

Configuration

Nu has early support for configuring the shell. You can refer to the book for a list of all supported variables.

To set one of these variables, you can use config set. For example:

> config set line_editor.edit_mode "vi"
> config set path $nu.path

Shells

Nu will work inside of a single directory and allow you to navigate around your filesystem by default. Nu also offers a way of adding additional working directories that you can jump between, allowing you to work in multiple directories at the same time.

To do so, use the enter command, which will allow you create a new "shell" and enter it at the specified path. You can toggle between this new shell and the original shell with the p (for previous) and n (for next), allowing you to navigate around a ring buffer of shells. Once you're done with a shell, you can exit it and remove it from the ring buffer.

Finally, to get a list of all the current shells, you can use the shells command.

Plugins

Nu supports plugins that offer additional functionality to the shell and follow the same structured data model that built-in commands use. This allows you to extend nu for your needs.

There are a few examples in the plugins directory.

Plugins are binaries that are available in your path and follow a nu_plugin_* naming convention. These binaries interact with nu via a simple JSON-RPC protocol where the command identifies itself and passes along its configuration, which then makes it available for use. If the plugin is a filter, data streams to it one element at a time, and it can stream data back in return via stdin/stdout. If the plugin is a sink, it is given the full vector of final data and is given free reign over stdin/stdout to use as it pleases.

Goals

Nu adheres closely to a set of goals that make up its design philosophy. As features are added, they are checked against these goals.

  • First and foremost, Nu is cross-platform. Commands and techniques should carry between platforms and offer first-class consistent support for Windows, macOS, and Linux.

  • Nu ensures direct compatibility with existing platform-specific executables that make up people's workflows.

  • Nu's workflow and tools should have the usability in day-to-day experience of using a shell in 2019 (and beyond).

  • Nu views data as both structured and unstructured. It is a structured shell like PowerShell.

  • Finally, Nu views data functionally. Rather than using mutation, pipelines act as a means to load, change, and save data without mutable state.

Commands

You can find a list of Nu commands, complete with documentation, in quick command references.

Progress

Nu is in heavy development, and will naturally change as it matures and people use it. The chart below isn't meant to be exhaustive, but rather helps give an idea for some of the areas of development and their relative completion:

Features Not started Prototype MVP Preview Mature Notes
Aliases X Initial implementation but lacks necessary features
Notebook X Initial jupyter support, but it loses state and lacks features
File ops X cp, mv, rm, mkdir have some support, but lacking others
Environment X Temporary environment, but no session-wide env variables
Shells X Basic value and file shells, but no opt-in/opt-out for commands
Protocol X Streaming protocol is serviceable
Plugins X Plugins work on one row at a time, lack batching and expression eval
Errors X Error reporting works, but could use usability polish
Documentation X Book and related are barebones and lack task-based lessons
Paging X Textview has paging, but we'd like paging for tables
Functions X No functions, yet, only aliases
Variables X Nu doesn't yet support variables
Completions X Completions are currently barebones, at best
Type-checking X Commands check basic types, but input/output isn't checked

Current Roadmap

We've added a Roadmap Board to help collaboratively capture the direction we're going for the current release as well as capture some important issues we'd like to see in Nushell. You can find the Roadmap here.

Contributing

See Contributing for details.

Thanks to all the people who already contributed!

License

The project is made available under the MIT license. See the LICENSE file for more information.

Issues
  • Table paging (Draft PR)

    Table paging (Draft PR)

    This adds paging to the table output.

    This does change a few methods to return String's instead of printing to screen (this may want to be reworked to be async?), so it's a little invasive.

    still a couple of warnings, and possible errors to be handled correctly. I will look at these soon.

    Cheers

    opened by rezural 47
  • Support for Anaconda `conda` environments from nushell

    Support for Anaconda `conda` environments from nushell

    Is your feature request related to a problem? Please describe. I love nushell, but it seems that nushell is not currently compatible with the python Anaconda distribution. I was not sure where to direct this request, but I thought I would start with the nushell folks. So Anaconda is a python distribution for scientific computing. Users can create conda virtual environments and then activate those environments using the command conda activate <environment_name>.

    When I tried to use conda activate myenv I got a message:

    CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
    To initialize your shell, run
    
        $ conda init <SHELL_NAME>
    
    Currently supported shells are:
      - bash
      - fish
      - tcsh
      - xonsh
      - zsh
      - powershell
    
    See 'conda init --help' for more information and options.
    
    

    Seems like this might be an upstream Anaconda issue, but I though I might check with the nushell team on whether there have been discussions about this.

    Describe the solution you'd like I would like to be able to activate Anaconda environments using nushell.

    Describe alternatives you've considered The alternative is to stay with zsh for anything involving Anaconda or python.

    Additional context Add any other context or screenshots about the feature request here. No other info. Thanks for your consideration. I will post to the conda maintainers as well.

    opened by 00krishna 39
  • Documentation for Nu commands (NO programming experience needed)

    Documentation for Nu commands (NO programming experience needed)

    We need documentation for the following Nu internal commands in any speaking language of your choosing:

    If interest in working on a command, please read this first.

    Please note: These are Nu commands, they may be the same name as commands you might be familiar from other shells but their usage, flags, and functionality might be different. Please make sure you have latest Nu installation 0.4.0 (you can confirm this by running the version command under Nu).

    You can learn more about how a Nu command works by looking at the source code or from Nu itself running help command where command is the command you are interested in documenting.

    VERY IMPORTANT you try and experiment with the command using Nu to get ideas. (Updated 18th May, 2020)

    • [ ] autoview
    • [ ] binaryview
    • [ ] clear
    • [ ] cp
    • [ ] describe
    • [ ] drop
    • [ ] each
    • [ ] empty?
    • [ ] keep
    • [ ] keep-until
    • [ ] keep-while
    • [ ] kill
    • [ ] match
    • [ ] merge
    • [ ] mkdir
    • [ ] mv
    • [ ] n
    • [ ] p
    • [ ] parse
    • [ ] post
    • [ ] pwd
    • [ ] range
    • [ ] rm
    • [ ] shuffle
    • [ ] skip-until
    • [ ] split-by
    • [ ] table
    • [ ] textview
    • [ ] touch
    • [ ] tree
    • [ ] with-env
    help wanted good first issue documentation meta-issue 
    opened by andrasio 34
  • Autoenv rewrite, security and scripting

    Autoenv rewrite, security and scripting

    Autoenv

    You no longer have to restart nushell after using autoenv trust. On startup, nushell reads nu-env.toml and stores the trusted files and their hashes. It uses the sha2 crate to allow for predictable hash values, since DefaultHasher can change between versions. This was by request, and if it would be better to avoid adding the dependency, it is simple to revert back to DefaultHasher.

    Autoenv trust/untrust

    You mark a .nu-env file as trusted or untrusted by running autoenv trust or autoenv untrust in the directory it is in, or by giving the commands the dir path. If you enter a directory with a .nu-env file which was either not trusted on startup, or has a different hash than it had on startup, nu-env.toml is read again and the .nu-env hash is checked against it. You still need to restart after using autoenv untrust, as I could not come up with a good way to reload this. Just re-reading nu-env.toml all the time would work, but it also feels wrong to read a file all the time like that.

    Scripting

    In addition to env, each .nu-env file may now contain the lines entryscripts, exitscripts and the section scriptvars. The keys in scriptvars must point to a valid command which resolves to a value. After that, the key and value are tracked and removed by nushell like regular environment variables listed under env. Commands in entryscripts and exitscripts are run when you enter and after you exit a directory. Nushell takes no responsibility for these and does not even show their output. Note that exitscripts are not run inside the directory they are declared in. [edit: new toml format]

    [env]
    k = "v"
    
    [scriptvars]
    myscript = "echo 'myval'"
    
    [scripts]
    entryscripts = ["touch hello.txt"]
    exitscripts = ["touch bye.txt"]
    

    All comments appreciated! Please do test it if you can.

    opened by samhedin 31
  • Add boolean and logic to nushell

    Add boolean and logic to nushell

    This commit does a few things:

    • Adds parsing for boolean and
    • It allows us to handle arbitrary length boolean expressions
    • It sets up a base upon which things like boolean or logic or other things like xor could use

    The big thing here is that with arbitrary length boolean expressions we can evaluate large complex expressions. The main motivation for this was to allow the where command to have more expressivity. So instead of something like:

    ls | where size > 100b | where type == File

    we can instead do the more readable expression of:

    ls | where size > 100b && type == File

    which more accurately represents the intent of the user.


    I wanted to open up this PR to get some feedback on what would be a better approach to the error handling (panic is not really something I want to use here), whether the syntax for boolean and is what's wanted (I just went with the common && but I also like and personally), and feedback for cleanup of the code and whether this is readable for others. I don't consider this complete just yet till this gets cleaned up and reviewed.

    Of course what's a PR without some proof that it works? Screen Shot 2019-08-27 at 19 00 41

    As a side note it was pretty fun to hack on this and I'm really excited to see nushell succeed 😄 It's exactly the kind of thing I've wanted in a shell.

    opened by mgattozzi 27
  • Starship - Prompt is mangled

    Starship - Prompt is mangled

    Describe the bug

    When using nu compiled with starship prompt support, the prompt appears mangled. See screenshot.

    %{%}~%{%} 
    %{%}->%{%} cd aur-build/nushell/
    
    %{%}nushell%{%} on %{%} %{%}%{%}master%{%} is %{%}📦 %{%}%{%}v0.5.1%{%} via %{%}🦀 %{%}%{%}v1.39.0%{%} 
    %{%}->%{%}
    

    The syntax highlighting appears to work though.

    To Reproduce

    Steps to reproduce the behavior:

    1. cargo install --path . --features starship-prompt --force
    2. nu

    The problem appears with both alacritty and kitty. It occurs when nu is started from zsh or bash.

    Expected behavior

    The prompt should appear as normal.

    Screenshots

    2019-11-23-224716

    Configuration

    • OS: Arch Linux
    • Version Kernel 5.3.12
    • Rust:
    # cargo --version && rustc --version
    cargo 1.39.0 (1c6ec66d5 2019-09-30)
    rustc 1.39.0 (4560ea788 2019-11-04)
    
    • Terminal: Kitty v0.14.6 or Alacritty fork v0.3.3
    • Optional features: starship-prompt
    opened by avandesa 27
  • Release #4 - Nu Scripts

    Release #4 - Nu Scripts

    Requirements for Nu scripts

    • [x] variables
    • [x] functions
    • [x] script loading/executing
    enhancement pri-1 
    opened by jntrnr 27
  • Compatibility issues with oh-my-posh

    Compatibility issues with oh-my-posh

    Describe the bug I'm trying to use oh-my-posh prompt engine in Nu and running into a few compatibility issues.

    1. ~~The main issue is the cursor always shows up on the line after the prompt. I've tried a few variations of calling the exe in the prompt function and I couldn't find a workaround.~~
    2. ~~Since Nu calls out to cmd to invoke oh-my-posh.exe it reports cmd as the shell. That's understandable and I don't think it's necessarily something that needs to be fixed by Nu.~~
    3. No last exit variable. I can't find any expression that reports the success of the last command. That's a pretty common segment in prompt functions.

    EDIT: Issues one and two have been resolved. See comments.

    To Reproduce Steps to reproduce the behavior:

    1. Run oh-my-posh 3.23.x as your prompt

    Screenshots image

    Configuration (please complete the following information):

    • OS: Windows 10 2004
    • Nu version: 0.21.0

    oh-my-posh theme: https://gist.github.com/cdhunt/495992d213745081ee193e1dc3a22965

    Stale 
    opened by cdhunt 26
  • Piping external to internal hangs

    Piping external to internal hangs

    I'm testing this pipeline.

    powershell -c "ps | convertto-json" | from-json

    The PowerShell PS command returns a lot more process information, but the shell just hangs. There's no process activity for nu.exe or Windows Command Processor. The shell is unresponsive.

    Just the external command, powershell -c "ps | convertto-json" works as expected and spits out json to the screen.

    polish 
    opened by cdhunt 24
  •  `$nothing` should be convertible to empty string #3711

    `$nothing` should be convertible to empty string #3711

    Resolves #3711

    This PR modifies into string so that it converts $nothing into the empty string, rather than "nothing".

    I noticed the tests in into_string.rs were not included in nu-command's tests. I think we want to run these tests, so I added a mod into_string; at the top of nu-command/tests/commands/str_/mod.rs. Let me know if these were intentionally excluded.

    I added a single test to cover the new behavior. I think should be good for review.

    Thanks!

    opened by pejato 24
  • fix markup

    fix markup

    null

    opened by tshepang 0
  • Support more zsh/bash keyboard shortcuts

    Support more zsh/bash keyboard shortcuts

    Related problem

    I've been trying out nushell, which looks great so far! However it looks like it's missing a few shortcuts that are standard (though a bit less well-known) and that I use everyday, such as M-. (alt-period) to insert the last word of the last command (cycling back commands).

    Describe the solution you'd like

    Here's my zsh bindkey output, which should be pretty close to stock IIRC.

    https://gist.github.com/sunshowers/7d1300af9c88e24780240d520d28b610

    ^ means ctrl, and ^[ means meta.

    Describe alternatives you've considered

    I tried configuring M-. locally but I didn't see a way to have the behavior I wanted, unfortunately. I could have missed something though!

    Additional context and details

    No response

    keybindings 
    opened by sunshowers 2
  • build for android failed

    build for android failed

    Describe the bug

    error: failed to compile `nu v0.40.0 (/tmp/tmp.2Z58tzZQ7X)`, intermediate artifacts can be found at `/tmp/tmp.2Z58tzZQ7X/target`
    
    Caused by:
      build failed
    

    no any other error logs.

    nushell.log

    How to reproduce

    curl -LO https://raw.githubusercontent.com/leleliu008/ndk-pkg/master/bin/ndk-pkg
    chmod a+x ndk-pkg
    mv ndk-pkg /usr/local/bin/
    
    ndk-pkg update
    
    ndk-pkg install nushell
    

    Expected behavior

    successfully build.

    Screenshots

    Screenshot 2021-11-26 154611

    Configuration

    No response

    Additional context

    https://github.com/nushell/nushell/archive/0.40.0.tar.gz

    Android NDK 21.4.7075529

    opened by leleliu008 0
  • Convert duration to nanoseconds

    Convert duration to nanoseconds

    Related problem

    I have a duration value that I would like to display as hours, e.g. "78 hours". Nushell displays it in multiple units, e.g. "3day 14hr 22min 44sec".

    Describe the solution you'd like

    Adding a way to convert a duration into any form of integer would probably be easiest to implement. Alternatively, a command like duration to-table or duration format would be easiest to use in my case.

    Describe alternatives you've considered

    The following commands either fail or don't provide the format I need:

    • $duration | into int
    • $duration | date format "%h"
    • $"($duration)"

    At the moment I'm using parse "{days}day {hours}hr {minutes}min {seconds}sec" to convert a duration into a table.

    Additional context and details

    No response

    enhancement 
    opened by raffomania 1
  • ps builtin reports cpu column as 0.000 for all processes on Apple Silicon M1

    ps builtin reports cpu column as 0.000 for all processes on Apple Silicon M1

    Describe the bug

    The ps builtin on my Macbook Pro M1 does not show anything other than 0.000 in the 'cpu' column.

    I have a proposed solution below.

    How to reproduce

    1. Start a busy process, eg.
    $ python
    Python 2.7.7 (v2.7.7:f89216059edf, May 31 2014, 12:53:48) 
    [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> x = 0
    >>> while True:
    ...     x += 1
    ... 
    
    1. ps | where cpu > 0
    2. observe no ouput.

    Expected behavior

    I expected nu to approximate the %cpu output of eg.
    `/bin/ps -caxo pid,pcpu,pmem,comm=20 | awk '$2 > 0{print}NR==1{print}'

    Screenshots

    image

    Configuration

    |key|value| |-|-| |version|0.40.0| |build_os|macos-aarch64| |rust_version|rustc 1.54.0 (a178d0322 2021-07-26)| |rust_channel|stable-aarch64-apple-darwin (default)| |cargo_version|cargo 1.54.0 (5ae8d74b3 2021-06-22)| |pkg_version|0.40.0| |build_time|2021-11-19 14:24:04 +11:00| |build_rust_channel|release| |features|ctrlc, dataframe, default, rustyline, term, which, zip| |installed_plugins|fetch, match, post, ps, sys|

    Additional context

    I had a look at what is possibly causing this, and it seems that in the upstream sysinfo crate (the version used in HEAD at least), the cpu time is zeroed in the initial calls to System::new_all() and System::refresh_all(), and requires and addition refresh to get an

    I found that sleeping for 50ms and calling System::refresh_processes() approximates the output of /bin/ps -caxo pid,pcpu,pmem,comm. I say approximates because the %cpu reported by /bin/ps fluctuates wildly each invocation, and I do the

    The 50ms sleep may be really unpalatable. It appears /bin/ps does not sleep at all; the man page claims "this is a decaying average over up to a minute of previous (real) time", but looking at the code for ps [https://opensource.apple.com/source/adv_cmds/adv_cmds-176.100.1/ps/] it appears to be populated from the kernel directly via a struct thread_basic_info.cpu_usage; /* scaled cpu usage percentage */.

    If we want to do it that way, it will need to be sent upstream to the sysinfo crate. Anyway, here's my proposed solution:

    diff --git a/crates/nu-command/src/commands/system/ps.rs b/crates/nu-command/src/commands/system/ps.rs
    index 85dc6400..a01636b7 100644
    --- a/crates/nu-command/src/commands/system/ps.rs
    +++ b/crates/nu-command/src/commands/system/ps.rs
    @@ -2,6 +2,7 @@ use crate::prelude::*;
     use nu_errors::ShellError;
     use nu_protocol::{Signature, TaggedDictBuilder, UntaggedValue};
     use sysinfo::{ProcessExt, System, SystemExt};
    +use std::{thread, time};
     
     pub struct Command;
     
    @@ -42,6 +43,8 @@ fn run_ps(args: CommandArgs) -> Result<OutputStream, ShellError> {
         let long = args.has_flag("long");
         let mut sys = System::new_all();
         sys.refresh_all();
    +    thread::sleep(time::Duration::from_millis(50));
    +    sys.refresh_processes();
     
         let mut output = vec![];
    
    

    image

    opened by obaudys 4
  • Using nu as default shell I can't start a wayland (sway) session

    Using nu as default shell I can't start a wayland (sway) session

    Describe the bug

    Hi all,

    I don't use any graphical login manager, after login onto my text session on VT1 I type 'sway' and that's it, at least under bash or fish but not with nushell.

    In the case of nushell, sway shows this error: 00:00:00.004 [ERROR] [wlr] [backend/wayland/backend.c:401] Could not connect to remote display: No such file or directory 00:00:00.004 [ERROR] [sway/server.c:53] Unable to create backend

    And it does not work, but I've checked that under nushell I can definitely start an Xorg session via startx and it works as expected.

    Is there a solution for this?

    How to reproduce

    1. Login onto vt1
    2. type. sway: It doesn't work
    3. type startx: It does work.

    Expected behavior

    Start a wayland session and work as expected

    Screenshots

    No response

    Configuration

    No response

    Additional context

    No response

    opened by antoniocorbi 4
  • ";" is slipping from quotes such as a git commit message

    Describe the bug

    When using ; inside quotes, like in a git commit massage: Screenshot from 2021-11-20 21-26-00

    How to reproduce

    Type, for example: git commit -m "update 1; update 2"

    The git commit message will be only "update 1".

    Expected behavior

    Work normally with quotes like in Bash.

    Screenshots

    No response

    Configuration

    No response

    Additional context

    No response

    opened by danimesq 1
  • It doesn't supports

    It doesn't supports "&&"

    Describe the bug

    When typing clear && git status, it outputs:

    error: clear unexpected && ┌─ shell:2:7 │ 2 │ clear && git status │ ^^ unexpected argument (try clear -h)

    How to reproduce

    Just run clear && git status or any other commands using &&

    Expected behavior

    Should work normally as it did in bash.

    Screenshots

    Screenshot from 2021-11-20 23-04-48

    Configuration

    ┌─ shell:1:1 │ 1 │ > version | pivot key value | to md │ ^ command > not found

    Additional context

    opened by danimesq 7
  • "cargo install nu" triggers recompilation every time

    Describe the bug

    Hi all!, first time here. If I install nushell via "cargo install nu" it all goes ok, but every time I re-run "cargo install nu" it downloads and recompiles everyting each and every time, no matter if I've just done the last "cargo install nu" seconds away.

    How to reproduce

    1. cargo install nu
    2. cargo install nu

    Expected behavior

    Do not recompile nushell if everything is up to date.

    Screenshots

    No response

    Configuration

    No response

    Additional context

    I'm using rustc 1.56.1 on GNU/Linux (ArchLinux).

    opened by antoniocorbi 2
Releases(0.40.0)
A CLI tool that allow you to create a temporary new rust project using cargo with already installed dependencies

cargo-temp A CLI tool that allow you to create a new rust project in a temporary directory with already installed dependencies. Install Requires Rust

Yohan Boogaert 34 Nov 24, 2021
Shell scripting that will knock your socks off

atom Shell scripting that will knock your socks off. NOTE: Click the image above for a video demonstration.

adam mcdaniel 245 Nov 18, 2021
🐢 Atuin replaces your existing shell history with a SQLite database, and records additional context for your commands

Atuin replaces your existing shell history with a SQLite database, and records additional context for your commands. Additionally, it provides optional and fully encrypted synchronisation of your history between machines, via an Atuin server.

Ellie Huxtable 1.1k Nov 25, 2021
a cute shell thingy that written in rust

a cute shell thingy that written in rust

奥田 龍馬 12 Aug 13, 2021
A shell for research papers

Reason: A Shell for Research Papers Did I ever read this paper? Which OSDI 2021 papers did I read? Which ones have the word 'Distributed' in their tit

Jae-Won Chung 108 Nov 14, 2021
Explore from the safety of your shell

turtlescan Explore from the safety of your shell Installation: cargo install turtlescan tui Starts a little tui which connects to your JSON-RPC server

Brian Cloutier 4 Sep 27, 2021
dune - A shell by the beach!

dune - A shell by the beach!

adam mcdaniel 593 Nov 26, 2021
A command-line shell like fish, but POSIX compatible.

A command-line shell like fish, but POSIX compatible.

Seiya Nuta 682 Nov 25, 2021
Zash - A Zuper Awesome Shell

Zash - A Zuper Awesome Shell Welcome to zash, its activily being developed and is not near a stable release. Installation Arch: yay -S zash Paru seem

Robiot 19 Nov 15, 2021
A very opinionated, zero-configuration shell prompt

A very opinionated, zero-configuration shell prompt

amy null 8 Nov 4, 2021
An interactive shell environment for exploring the p2panda protocol

An interactive shell environment for exploring the p2panda protocol. Uses a mock node and clients to simulate network logic.

null 3 Nov 11, 2021
Self-contained template system with Handlebars and inline shell scripts

Handlematters Self-contained template system with Handlebars and inline shell scripts Introduction Handlematters is a template system that combines Ha

Keita Urashima 2 Nov 23, 2021
CLI utility to move (or rename) your files to a new location and redirect all of its symbolic links, to the new path

Move Links CLI utility to move (or rename) your files to a new location and redirect all of its symbolic links, to the new path (or name). Usage execu

Ben Mefteh 17 Sep 15, 2021
A static, type inferred and embeddable language written in Rust.

gluon Gluon is a small, statically-typed, functional programming language designed for application embedding. Features Statically-typed - Static typin

null 2.4k Nov 30, 2021
Type-safe, compiled Jinja-like templates for Rust

Askama Askama implements a template rendering engine based on Jinja. It generates Rust code from your templates at compile time based on a user-define

Dirkjan Ochtman 1.5k Nov 21, 2021
Experimental type-safe geometric algebra for Rust

Projective Geometric Algebra This library is a Rust code generator, generating the mathematics you need for a geometric algebra library. I made it mos

Emil Ernerfeldt 22 Nov 2, 2021
This crate provides a convenient macro that allows you to generate type wrappers that promise to always uphold arbitrary invariants that you specified.

prae This crate provides a convenient macro that allows you to generate type wrappers that promise to always uphold arbitrary invariants that you spec

null 36 Sep 12, 2021
A cross-platform GUI library for Rust focused on simplicity and type-safety

A cross-platform GUI library for Rust, inspired by Elm

Héctor Ramón 12k Nov 29, 2021
A quick and dirty Space Invaders type game in Bevy, with attached tutorial.

This article is in-development and will be released in full form soon. It'll appear on Medium (my publisher likes that), with this as a the accompanyi

Herbert 14 Nov 14, 2021
A memory efficient immutable string type that can store up to 24* bytes on the stack

compact_str A memory efficient immutable string type that can store up to 24* bytes on the stack. * 12 bytes for 32-bit architectures About A CompactS

Parker Timmerman 123 Nov 30, 2021
Turbine is a toy CLI app for converting Rails schema declarations into equivalent type declarations in other languages.

Turbine Turbine is a toy CLI app for converting Rails schema declarations into equivalent type declarations in other languages. It’s described as a to

Justin 2 Oct 20, 2021
Tyrade: a pure functional language for type-level programming in Rust

A pure functional language for type-level programming in Rust

Will Crichton 222 Nov 16, 2021
Generator of Firestore rules and type safe client code.

Generator of Firestore rules and type safe client code. Usage [WIP] Install from npm or curl. $ npm install -g firegen Setting your yml. # firegen.yml

Ubugeeei 2 Oct 13, 2021
Mononym is a library for creating unique type-level names for each value in Rust.

Mononym is a library for creating unique type-level names for each value in Rust.

MaybeVoid 38 Nov 23, 2021
A Rust framework for building context-sensitive type conversion.

Xylem is a stateful type conversion framework for Rust.

Jonathan Chan Kwan Yin 2 Nov 18, 2021
A fusion of OTP lib/dialyzer + lib/compiler for regular Erlang with type inference

Typed ERLC The Problem I have a dream, that one day there will be an Erlang compiler, which will generate high quality type-correct code from deduced

Dmytro Lytovchenko 19 Nov 23, 2021
A type-safe, high performance ORM framework

A type-safe, high performance ORM framework

dark-flames 7 Nov 23, 2021
A new kind of terminal

notty - not a typewriter notty is a virtual terminal like xterm, gnome-vte, sh, or rxvt. Unlike these programs, notty is not intended to emulate a DEC

Saoirse Shipwreckt 2.1k Nov 19, 2021
The new, performant, and simplified version of Holochain on Rust (sometimes called Holochain RSM for Refactored State Model)

Holochain License: This repository contains the core Holochain libraries and binaries. This is the most recent and well maintained version of Holochai

Holochain 489 Nov 21, 2021