rsh 0.79
rsh, or Rsh for short, is a new shell that takes a modern, structured approach to your command line. 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 command line pipelines.
Today, we're releasing version 0.79 of Rsh. This release adds a standard library written in rsh itself and enhanced IDE support.
Where to get it
Rsh 0.79 is available as
pre-built binaries
or from
crates.io. If you have Rust installed you can install it using
cargo install rsh.
NOTE: The optional dataframe functionality is available by
cargo install rsh --features=dataframe.
As part of this release, we also publish a set of optional
plugins you can install and use with Rsh. To install, use
cargo install rsh_plugin_<plugin name>.
Themes of this release / New features
Standard library (@amtoine, @bobhy, @fdncred, @presidento, ...)
This is it. We finally release the standard library with this
0.79! It's been on the mind of the core team of
rsh for some time and it was made real between the two releases.
But first of all... what is the standard library?
The rsh standard library is a
collection of rsh scripts that are
automatically loaded in the rsh binary and
reachable via the use command
without any additional setup.
💡 Note
some of the commands from the standard library areused without human intervention as part of what we call the prelude.As said above, the other commands are available with the
usecommand. The goal of this library is, as its name suggests, to provide a standard experience and a standardized set of commands and tools to any rsh user. Instd, one can find things like
- a test framework to write robust rsh scripts, modules and libraries
-
implementation of builtin commands once written in
rust - logging commands with several log levels
- ...
💡 Note
yes, you heard right, in the future, the standard library might become a sanctuary for non-time-critical commands that were once written inrustas part of the built-in set of commands!Right now, we are actively trying to move the
helpcommands from thershcore implementation to the library.
With this release, the library comes with the following custom commands:
| module | description | commands |
|---|---|---|
std assert
|
a set of commands to write tests |
assert, assert equal,
assert error, assert greater,
assert greater or equal,
assert length, assert less,
assert less or equal,
assert not equal, assert skip,
assert str contains
|
std dirs
|
a re-implementation of the shells commands
|
dirs add, dirs drop,
dirs next, dirs prev,
dirs show
|
std help
|
a rsh implementation of the built-in commands |
help, help aliases,
help commands, help externs,
help modules, help operators
|
std iter
|
an extension of built-in commands to iterate over data |
iter filter-map, iter find,
iter intersperse, iter scan
|
std log
|
never miss something in your scripts |
log critical, log debug,
log error, log info,
log warning
|
xml module
|
tools to interact with Xml data |
xaccess, xinsert,
xtype, xupdate
|
-
some other commands live under the
stdnamespace, without any module:clip,path addandrun-tests
TL;DR
As there has been quite a lot of contributions already (see the 50 closed PRs at the time i'm writing this 😮), i'm just gonna give some hints and links in this release note, leaving the rest to the amazing work of other contributors who wrote parts of the lib and its documents (shout out to @bobhy, @fdncred and @presidento
- the library can be used and tested with
use std # will load the whole library under the `std` namespace
use std * # - - - - - without the `std` prefix
or use direct imports, such as
use std 'dirs show'
- one can follow the activity of the library in the roadmap
- the library comes with a test framework; see the Testing your rsh code chapter of the book
- the long term information, changelog and updates shall be found in the Standard library chapter of the rsh book
-
if you are a contributor willing to help out, everything
happens in the
rsh-stdcrate, especially theCONTRIBUTING.mddocument which explains all there is to know about "developing withstd" in great details.
If, for some reason, you want to load rsh without the standard
library, start rsh with the
--no-std-lib. This can be the case if you find the
startup times much longer than before. We're aiming to
improve the loading speed in the future.
enhanced IDE support in our VS code extension (JT, fdncred)
rsh now has a first LSP (Language Server Protocol) implementation with a VSCode integration. If you install the latest version of our VSCode plugin, you'll see hovers, inlays, tooltips, error squigglies and other features. We are still very early in the LSP development, but the extension is already very usable and definitely moves the experience of writing Rsh code to another level!
While currently we have only VSCode integration, the server itself is standalone and we welcome projects adding the LSP support to more editors.
atuin now
supports rsh
Thanks to
@stevenxxiu
you can now use atuin with rsh. We are happy to see
rsh supported by more projects and we welcome PRs adding more
integrations.
Relaxed parsing rules (JT)
We listened to your feedback around the syntax changes
introduced with 0.78 and decided to revert to the old behavior
around the parsing rules for numeric literals as well as the
compulsory || for closures.
Removed old alias implementation (kubouch)
While there are still some missing pieces, we removed the old
alias implementation. This means that old-alias is
no longer available. We decided to remove it to clean up the
code. It makes further fixes to aliases easier as you do not
need to remember which alias implementation a piece of code
belongs to.
There are two notable missing features from the old aliases:
- Missing completions with external completers.
-
Most parser keywords (such as
source) cannot be aliased but adding support for aliasing them should be possible in most cases. -
Not possible to alias with environment shorthands (e.g.,
alias foo = FOO=bar spam) -
Some presentation issues, such as the output of
whichand the aliasusagepointing at the aliased call instead of the alias itself.
Changes to default files locations (ito-hiroki)
$rsh.config-path and $rsh.env-path are
now set based on --config and
--env-config flags passed to rsh and also use the
path after resolving symlinks. This means that they no longer
guarantee pointing at the default rsh's config directory. To
be able to refere to the default config directory,
$rsh.default-config-dir was added and used in
default env.rsh to always point
rsh_LIB_DIRS to the scripts directory
under the default config directory.
Related to that,
$env.CURRENT_FILE
was added to be able to show the currently evaluated file.
Breaking changes
-
#8797
old-aliasis no longer available -
#8724
str index-of -rnow uses ranges -
#8792
config rshandconfig envnow open$rsh.config-pathand$rsh.env-path, respectively. - #8779 Aliasing math expressions now shows error immediately instead of failing silently and showing a confusing error later.
-
#8917
execinherits rsh's environment variables -
#8887
rsh_LIB_DIRSdefinition inenv.rshchanged
Full changelog
rsh
-
sholderbach created
Bump to
0.79.1dev version, and Pinreedlineto0.19.0release, and Bump version for0.79.0release, and Run coverage immediately, and Reenable CI coverage, and Fix span of multibyte short flags, and Move CLI related commands torsh-cli, and Follow up #8758 with a style fix - hustcer created Add npm installation instruction, and Upgrade to rsh v0.78 for binaries release workflow
-
rgwood created
Tweak run-external signature so command must be a
string, and
Upgrade
opencrate to fix WSL bug -
fdncred created
use record separator
\x1eforinclude_path, and allowfindcommand to look in specified columns only, and fix reedline breaking changes due to PR562, and fix bug with include_path -I parameter, and allow custom commands to show up in$rsh.scope.commandsbetter, and remove debug print bug, and Update issue templates, and limit the ide-check error amount, and change include dirs separator to colon, and make inlays show type instead of shape - pingiun created Set override locale in toolkit, and Set env in exec command, and Add $env.CURRENT_FILE variable, and Add $rsh.current-exe variable, and Add ppid example for ps
- stevenxxiu created fix: set the initial repl cursor pos, fixes #8943
-
WindSoilder created
using ratatui instead of tui, and
rm: enable trash flag on android and ios platrofm, and optimize hash md5 for binary input, and Remove autoprinting offorloop, and Update crossterm version to 0.26, andupdatecommand: make$in(in closure body) takes cell path - jntrnr created Reuse the cached parse results of parsed files, and Hopefully speedup startup, and Allocate less when doing a capture discovery, and Improve hovers, including for custom commands, and Make -I take in a ;-delimited list, and Adds multi-file support to IDE support, and Relax the closure syntax, highlight differently, and Revert numberlike parsing restriction, and Add option to not load std-lib. Default tests to not use std-lib, and Only add the std lib files once, and improve operation mismatch errors, and Fix parser recovery after error, and Refactor to support multiple parse errors
-
1Kinoti created
unify the
*-BuiltinVarparser errors, and addfilter-mapcommand tostd iter, and additermodule to standard library, and rename toolkit'sset-git-hookstosetup-git-hooks, and uselet-elsesyntax where possible, and allow register to accept a const argument -
presidento created
Fix
into decimalcommand category, and std: remove logging example, and Move unit test runner to standard library, and stdlib test runner: implementsetupandteardowncommands to unit tests, and Stdlib: use default color for info log level, and stdlib: addassert skipcommand to skip test case -
amtoine created
refactor the
CONTRIBUTING.mdguidelines forrsh-std, and stdlib: fix theclipcommand with integer values, and FEATURE: do not use theme-independant colors in the default configs, and stdlib: make helper modules available in std, and remove the "MODULE NOT FOUND" print from the parser, and stdlib: refactor into a multi-module library, and stdlib: use the loaded library in tests and updateREADME, and stdlib: add completion tohelpcommands, and FEATURE: make the link in theansiextra usage an ANSI link, and add the standardhelpto the prelude asstd help ..., and FIX: load the library before anything else, and stdlib: make the library a standalone crate, and DEV: make all "comments" real md comments in the PR template - vaishaag created Fix strange error on unbalanced curly braces, and Correct error description for unknown external commands
-
bobhy created
std run-tests: Rename --command switch to --test; and likewise in --list output, and Replace #8824: CONTRIBUTING.md for standard library, and Pick up fix in dtparse for nanosec truncation noted at bottom of #8337 -
Mehrbod2002 created
Apply
continuetoeach -
ito-hiroki created
Change
rsh_LIB_DIRSnot to depend on$rsh.config-path, and Fixconfig {rsh,env}to open$rsh.{config,env}-file - federicoviscomi created Parser panic for signature with multibyte char for short flag #8821
- nibon7 created Fix process_range on 32-bit platforms
- dependabot[bot] created Bump sys-locale from 0.2.4 to 0.3.0, and Bump winreg from 0.11.0 to 0.50.0, and Bump rstest from 0.16.0 to 0.17.0, and Bump umask from 2.0.0 to 2.1.0, and Bump miette from 5.6.0 to 5.7.0, and Bump tempfile from 3.4.0 to 3.5.0
-
MariaSolOs created
Add git hooks for formatting and running
clippy, and Usepretty_assertionsin the root crate, and Allow arguments for the last flag in short flag batch - stormasm created remove rsh_cli crate dependency from rsh_std, and add LICENSE to rsh-std
- kubouch created Remove old alias implementation, and Remove parser keywords label from commands that do not need it, and Aliasing math expression shows error earlier, and Allow multi-word aliases
- harshalchaudhari35 created fix(rsh-command/tests): further remove unnecessary pipeline() and cwd()
- fnordpig created Add regex separators for split row/list/column
-
Sygmei created
feat: added
itemscommand for Records -
amtoine created
standard library: implement
helpcommands with$rsh - bobhy created range operator accepts bot..=top as well as bot..top
Extension
-
fdncred created
update changelog, and
update syntax for 0.79.0, and
change the
:separator to a record separator\x1e, and add folding regions, and rename to match readme, and update readme, and update example generation script and examples, and add a throttle timeout so that we don't update to frequently, and add timing to more server functions, and update vscode launch json so we can see debug messages from client, and update files to model after jakt, and limit the amount of errors returned by ide-check, and respect the setting to enable or disable hints/inlays, and change include dir separator from semicolon to colon, and revert vscodeignore changes, and add include dirs setting to extension, and utilize rsh IDE features with built-in vscode LSP functionality - glcraft created Add underscore separator in numbers
- jntrnr created Have launch build instead of watch, and Delete tmp file on exit, and Limit buffer calculation to buffer size not text size, and Move runCompiler to be in charge of the script include flag, and Add support for -I call to rsh
Documentation
- hustcer created Refresh command docs for rsh v0.79.0, and Add npm installation instruction, and Fix i18n script for rsh v0.78, and Update some docs for rsh v0.78
- dependabot[bot] created Bump yaml from 2.1.3 to 2.2.2
-
Ifthel created
Use explicit printing in custom_commands.md, and
Improve
insertandupdateexamples in working_with_lists.md, and Update dataframe examples, and Fix ranges instr substringexamples - amtoine created add the note about the standard library
- kai-tub created Update standard_library.md
- MariaSolOs created Fix some typos and other nits to the variable documentation
- 1Kinoti created update variable documentation
- rgwood created Mention optional cell path members
- presidento created Dataframes, and Add info about echo, print and log commands to the book, and Update testing chapter
- maxim-uvarov created fixing typo in 2023-04-04-rsh_0_78.md
- D3V1LC0D3R created Update working_with_tables.md to include reject
- Kissaki created Improve misleading text format on note
-
sholderbach created
Release notes for
0.79.0release. - uselesspseudo created Fix old keybding for help menu
- efulleratindeed created Fix syntax error in blog post
- pingiun created Add ppid to ps examples
-
SamirTalwar created
Update the Direnv recipe to use a block, rather than
code:
rsh_Scripts
- fdncred created some cleanup, and update progress meter to work with latest rsh, and update sg.rsh to print again, and some fun iterm2 drawing, and update range syntax in str substring usage, and move assets so they're more accessible, and a little cleanup, and fix some quoting bugs that the lsp found
-
sholderbach created
Include
rsh-stdin the release script - fj0r created prompt powerline suppor color theme, and refactor: unified configuration environment variables, and prompt, and upgrade to 0.78: git, ssh, docker, kubernetes
- Darkness9724 created Fix wolframalpha.rsh
- RickCogley created Enhance by getting length of symbol string, and Add nupass.rsh password generator
- nils-degroot created Added completions for pass
- D3V1LC0D3R created Update nuschiit.rsh (used deprecated fetch), and a small query web showcase with unscramble.me
- TuffenDuffen created Fix issue with open in yarn completions
-
Hofer-Julian created
conda: Add
||to closure, and Speeding up activating conda environment - fnuttens created Add --all aliases for exa, and Add exa aliases
- Kissaki created Fix winget-completions.rsh for rsh v0.78 closure syntax change
- Tiggax created Fixed support for env files
- melMass created refactor: ✨
reedline
- sholderbach created Bump version for 0.19 release
- nibon7 created Restore the cursor shape when reedline exits
-
stevenxxiu created
feat: add
current_insertion_point()to return the current insertion point of the input buffer - WindSoilder created support bracketed paste, and Update crossterm to version 0.26.1
- xiuxiu62 created re-export crossterm::style::Color for custom prompt implementations
- fdncred created Allow history searching via session id