Nushell 0.63
Nushell, or Nu for short, is a new shell that takes a modern, structured approach to your commandline. It works seamlessly with the data from your filesystem, operating system, and a growing number of file formats to make it easy to build powerful commandline pipelines.
Today, we're releasing version 0.63 of Nu. This release is the first to include the 'overlays' feature, hooks, lazy dataframes, and more.
Where to get it
Nu 0.63 is available as pre-built binaries or from crates.io. If you have Rust installed you can install it using cargo install nu
.
If you want all the built-in goodies, you can install cargo install nu --features=extra
.
As part of this release, we also publish a set of optional plugins you can install and use with Nu. To install, use cargo install nu_plugin_<plugin name>
.
Themes of this release
Overlays (kubouch)
We've added a new concept into this release that merges a few of our previous design ideas together: overlays. You can think of overlays like layers in a paint program. They work together to give you a set of commands, environment variables, and more that you can turn on and off as needed.
For example, we can create an overlay to work in:
(zero) > module code { export env BAZ { "baz" } }
(zero) > overlay add code
(code) > $env.BAZ
baz
(code) > let-env BAGR = "bagr"
(code) > $env.BAGR
bagr
(code) > overlay remove code
(zero) > # environment back to what we started with
Just like layers in a paint program, changes you make (like the update to the environment above) are part of the layer. You can use --keep-custom
to keep the changes you have made even after you hide the overlay. Using add
and remove
are effectively like show
and hide
, allowing you to quickly switch into a new context, do some work, and switch out with little effort.
Hooks (sophiajt)
Starting with 0.63, you can now set up hooks that will run code under certain conditions. These hooks run after your code has finished evaluating.
Let's look first at how to set up the hooks, and then see what the hooks output. To set up a hook, you pick the kind of hook and then configure a block of code to run when that hook fires:
hooks: {
pre_prompt: [{
print "pre_prompt hook"
}]
pre_execution: [{
print "pre_execution hook"
}]
env_change: {
PWD: [{|before, after|
print $"PWD environment variable changed from ($before) to ($after)"
}]
}
}
Using this example, we can watch the hooks fire:
/home/sophiajt/Source/nushell〉cd ..
pre_execution hook
pre_prompt hook
PWD environment variable changed from /home/sophiajt/Source/nushell to /home/sophiajt/Source
/home/sophiajt/Source〉
Used together with the "overlays" feature above, we hope to open up the possibility for a lot of powerful interactions with the shell while still keeping the workflow that makes Nushell special.
Lazy dataframe support (elferherrera)
We are starting to support a new way to query dataframes by using lazyframes. This new concept will allow users to build logical plans for the data operations which will result in a reduction of the dataframe processing time.
Lazy dataframes are accessed through the same dfr
command and give you a way to build up a pipeline to execute in a more optimal way than the previous eager dataframes. For example, you can perform your aggregations and group-bys lazily, and then work on the results instead of paying for the processing time of having two separate steps.
New commands
- (Returned from the engine rewrite)
histogram
for checking distributions right inside nushell (WindSoilder) config nu
andconfig env
to easily edit your nushell configuration files with your editor of choice (Kangaxx-0/vFrankZhang)str title-case
(krober)> 'this is a test case' | str title-case This Is A Test Case
- Many new
db
subcommands (elferherrera)
Quality-of-life Improvements
More commands contain additional search terms to find them if you don't remember their exact name. (victormanueltn, LawlietLi) This is a great way to help out by contributing! More information can be found here.
print -n
option to print output without an additional new-line (fdncred)flatten
now has a more consistent behavior for nested records and tables. (WindSoilder) This now more closely matches the pre-0.60 flatten, and should help create more predictable output.We now support octal binary literals
0o[777]
similar to the hexadecimal0x[FF]
and binary0b[11111111]
literals (toffaletti)cd
accepts abbreviation of paths to quickly jump to nested directories based on unique prefixes (fdncred)> $env.PWD ~/some/path > cd d/s/9 > $env.PWD ~/some/path/deep/space/9
Various improvements make the completions feel more polished (herlon214, PurityLake)
If
$config.buffer_editor
is not set rely on the$env.EDITOR
and$env.VISUAL
environment variables to find a text editor to edit longer pipelines or yourconfig ...
(Kangaxx-0/vFrankZhang, sholderbach)When invoking
nu
to run a script you can now pass the--config
flag to load yourconfig.nu
and have the definitions available when running the script (WindSoilder)Similarly you can change the table appearance with the
--table-mode
flag when invokingnu
(fdncred)
Note: this is a shortened list. For the full list, see the "Changelog" section below
Breaking changes
Changed default keybindings:
Old binding | New binding | Action | Reason for the change |
---|---|---|---|
Ctrl-x | Ctrl-r | Visual history search menu | We replaced the simple history search (previously bound to Ctrl-r , cmd: SearchHistory ) with the menu that supports previewing several entries at once for quick navigation |
Ctrl-q | F1 | Interactive help menu | F1 is generally the convention for help information, with this menu you can search for commands browse through their documentation and pick examples to include/run |
Looking ahead
Here are a few of the things we're working on:
SQLite based history. This will maintain a larger number of entries that can searched using date, usage or text.
Input/output types. These will allow commands to be specialized based on the input they're given as we well as allow the typechecker to check that commands can connect on the pipeline together.
And more - we're still looking ahead to IDE support, better database support, and more.
Changelog
Nushell
- kubouch created Overlay keep, and Add Nushell REPL simulator; Fix bug in overlay add, and created Overlays
- sophiajt created Bump to 0.63, and Add environment change hook, and Revert "Try to do less work during capture discovery", and Try to do less work during capture discovery, and Try removing debuginfo for ci builds, and Allow hooks to be lists of blocks, and Add hooks to cli/repl, and Bump to the 0.62.1 dev version
- sholderbach created Pin reedline v0.6.0 for the nushell v0.63.0 release, and Add meta command for the config subcommands, and Fallback for
config.buffer_editor
fromEDITOR
, and Refer to the span oferror make
if not given, and Use bleeding edge reedline, with fix for #5593, and Change miette theme based on ANSI config, and Use effectively unlimited history size if not set, and Move help menu to canonicalF1
binding - WindSoilder created fix date format, and load config when required, and Make flatten works better and predictable, and adjust flatten default behavior, and Don't report error when cwd is not exists., and Fix flatten behavior, and add quantile column in histogram , and fix select tests, and fix move test, and Make format support nested column and use variable, and use reverse iter on value search, and Fix Value::Record compare logic, and pass uniq tests., and fix zip test, and add rename, and Implement histogram command, and keep metadata while format filesize, and add format filesize, and complete some commands tests, and Document out positional argument type in help message, and created make cd recornize symbolic link, and implement seq char command to generate single character sequence
- hustcer created fix typo for
version
command, and Fix #5578, assume pipe file be zero-sized, and feat: addtutor list
support, remove tutorengine-q
, fix: #4950, and Fix #3899, makemv
andrm
to be quiet by default, and opt: improve ls by call get_file_type only one time, and Improve #4975 of filteringls
output by size issue, and Fix #5469, making $nothing or null convert to filesize of 0B, and Fixto csv
andto tsv
for simple list, close: #4780, and feat: add disable field type inferencing forfrom csv
andfrom tsv
, fix: #3485 and #4217 - merelymyself created Allow for test_iteration_errors to work when run as root, and Allows the test
commands::ls::fails_with_ls_to_dir_without_permission
to work when run as root, and Allowing for flags with '=' in them to register as flags., and Adds fix for when multiple flags are in one line., and created Fixing the flag issue, and Adds flags and optional arguments to view-source - Kangaxx-0 created Add config command, and Add verbose, and Add feedback to cp
- toffaletti created Add octal binary literals
- victormanueltn created Add search term to str substring command., and Add search terms to build-string command.
- LawlietLi created feat: add search terms to network
- IanManske created Fix help menu panic.
- jaeheonji created feat: apply the
--numbered
option to acc inreduce
command. - krober created Add str title-case, and Str casings reorganization & description updates
- fdncred created move items to showcase, and refactor all
write_all
s to ensure flushing, and make print flush, and table refactor for readability, and add the ability to change table mode when running script, and add--table_mode
-m
parameter, and refactor for legibility, and adjust where prompt markers go, and add -n flag to print to print without a newline, and enable cd to work with directory abbreviations, and fix bug in shell_integration - rgwood created Revert "Enable backtraces by default (#5562)", and Upgrade trash dependency, and Enable backtraces by default, and Remove doctests CI action, and CI: bust caches, and Look up git commit hash ourselves, drop libgit2 dependency, and More CI work, and Change history menu keybinding from ctrl+x to ctrl+r, and Enable converting dates to ints, and Parse timestamps as UTC by default, and Display range values better, and Handle int input in
into datetime
, and Enable string interpolation for environment shorthand - efugier created feat(errors): more explicit module_or_overlay_not_found_error help me…
- ocitrev created Sync resources version
- elferherrera created Lazy dataframes, and join and from derived tables, and Database commands
- herlon214 created nu-cli/completions: add custom completion test, and nu-glob: add fs::symlink_metadata to detect broken symlinks, and nu-command/filesystem: fix rm .sock file, and nu-cli/completions: verify case for matching dir, .nu, file and command, and nu-cli/completions: add variable completions test + refactor tests, and nu-cli/completions: add tests for flag completions, and nu-cli/completions: add tests for dotnu completions, and nu-cli/completions: send original line to custom completer
- njbull4 created cp, mv, and rm commands need to support -i flag
- CozyPenguin created bump umask crate to 2.0.0
- jmoore34 created Update comment in default_config.nu [skip ci]
- pejato created Make $nothing | into string == ""
- onthebridgetonowhere created Fix cp bug
- PurityLake created Made a change to completion resolution order
- gipsyh created Add split number flag in
split row
Documentation
- sholderbach created Remove outdated reference to
open
pager, and Document the octal binary literals, and Mention default values for command parameters. - unional created docs: add
pwd
tocoming_from_bash.md
- hustcer created Update zh-CN home page and keep the Chinese and English docs in sync, and Update some zh-CN translations from commit: 008c89fc26, and Update some zh-CN translatons from commit: 6f61fadb69
- rgwood created Update front page
- mdmundo created Update windows_terminal_default_shell.sh
- kubouch created Add env.nu to env conversions section, and Document config as environment variable
- TaKO8Ki created Translate
/ja/README.md
to Japanese - flying-sheep created Document $in
Nu_Scripts
- thibran created Misc tools
- Suyashtnt created feat(custom-completions): add yarn completion
- sophiajt created update nu weekly script
- fdncred created add html colors, and add progress bar examples + some benchmarks, and help with pr, and remove title because it breaks kitty
- Yethal created Update remoting.nu, and Added remoting.nu
- Jacobious52 created Auto generation completion help parser
- kurokirasama created added maths, defs and weather scripts
- drbrain created Allow relative entries in CDPATH
reedline
- sholderbach created Prepare the v0.6.0 release, and Do not allocate eagerly for full history capacity, and Start developer documentation
- petrisch created Typo
- ahkrr created fix: list_menu not accounting for index + indicator
- sadmac7000 created Fix vi-mode word motions
- DhruvDh created Use a default terminal size if reported terminal size is 0, 0