Version 0.13 has been released on 2020-01-01, 18 months after 0.12, bringing many new features and bugfixes.
As usual, prebuilt binaries are offered for most common platforms.
Breaking changes
-
This release sees a total rewrite of the line editor. As a result, there have been some changes to its API, the
edit:module:-
Binding tables no longer support the
defaultkey for overriding the default behavior of modes. All theedit:<mode>:defaultfunctions have been removed:edit:completion:default,edit:history:default,edit:insert:default,edit:listing:defaultandedit:navigation:default.The
edit:insert-keyandedit:listing:backspacefunctions have also been removed. Their functionalities are now baked into the default behavior of the insert and listing modes. -
The
edit:history:listfunction has been removed. Useedit:command historyinstead. -
The
edit:lastcmd:accept-linefunction has been removed. Useedit:listing:acceptinstead. -
The
edit:-narrow-readfunction and theedit:narrow:module have been removed. Usededit:listing:start-custominstead. -
The
edit:styledfunction has been removed. Usedstyledinstead. -
The
edit:insert:startfunction has been removed. Useedit:close-listinginstead. -
The
edit:location:matchervariable andedit:location:match-dir-patternfunction have been removed. There is no replacement yet; the location matcher is not customizable now, although it may be made customizable again in a future version. -
The
edit:completion:trigger-filterfunction has been removed. The completion mode now always focuses on the filter, and it is no longer possible to focus on the main buffer during completion. -
The
edit:history:listfunction has been removed. There is no replacement yet.
-
-
The names of basic colors used in
styledhas changed to be more standard:-
The
lightgraycolor (ANSI code 37) is now calledwhite. -
The
graycolor (ANSI code 90) is now calledbright-black. -
The
whitecolor (ANSI code 97) is now calledbright-white. -
All the
lightX(ANSI codes 90 to 97) colors have been renamed tobright-X.
-
-
Builtin math functions now output values of an explicit
float64number type instead of strings.
Notable fixes and enhancements
-
The editor now has a minibuffer, bound to Alt-x by default. The minibuffer allows you to execute editor commands without binding them to a key.
-
The editor now has an experimental “instant mode” that can be activated with
edit:-instant:start. It is not bound by default. The instant mode executes the code on the command line every time it changes.WARNING: Beware of unintended consequences when using destructive commands. For example, if you type
sudo rm -rf /tmp/*in instant mode, Elvish will attempt to executesudo rm -rf /when you typed so far. -
The
styledbuiltin now supports more color spaces:-
Colors from the xterm 256-color palette can be specified as
colorN, such ascolor22. -
24-bit RGB colors can be specified as
#RRGGBB, such as#00ffa0.
Proper terminal support is required to display those colors.
-
-
Elvish can now output results in JSON in compile-only mode, by specifying
-compileonly -json, thanks to @jiujieti (PR #858) and @sblundy (PR #874). -
In redirections, the 3 standard file descriptors may be specified as names (
stdin,stdout,stderr) instead of numbers, thanks to @jiujieti (PR #869). -
Code such as
x = $xwhere$xhas not been defined now correctly results in a compilation error, thanks to @jiujieti (PR #872). -
The
whilespecial form now supports anelseclause, thanks to @0x005c (PR #863). This feature was previously documented but missing implementation. -
The command
%no longer crashes Elvish when the divisor is 0, thanks to @0x005c (PR #866). -
Elvish is now resilient against terminal programs that leave the terminal in non-blocking IO state (issue #588 and issue #822).
-
Wildcard patterns of multiple question marks (like
a??) are now parsed correctly (issue #848). -
A new floating-point numeric type has been introduced, and can be constructed with the
float64builtin function (issue #816). -
A new
$nilvalue has been introduced to represent lack of meaningful values. JSONnullvalues are converted to Elvish$nil. -
Two new builtins,
only-bytesandonly-valueshave been introduced. They can read a mixture of byte and value inputs and only keep one type and discard the other type. -
The
usespecial form now accepts an optional second argument for renaming the imported module. -
A new
chrbuiltin that converts a number to its corresponding Unicode character has been added. -
New editor builtin commands
edit:kill-word-rightandedit:kill-word-righthas been added, thanks to @kwshi (PR #721).