Version 0.10 has been released two and a half months after 0.9, bringing many new features and enhancements. The second issue of Elvish Newsletter accompanies this release.
Breaking changes
-
If you are upgrading from an earlier version, Elvish will complain that your database is not valid. This is because Elvish now uses BoltDB for storage. A database migration tool is available.
-
Breaking changes to the editor API:
-
The
$edit:completermap is now known as$edit:arg-completer. -
The keybinding API has been changed (again). Keybindings for different now live in their own subnamespaces. For instance, keybindings for insert mode used to be
edit:binding[insert]but is nowedit:insert:binding. -
Module names of some editor modes have also been changed for consistency. The completion mode now uses the
edit:completionmodule (used to beedit:compl). Location mode:edit:location; navigation mode:edit:navigation. -
Byte output from prompts now preserve newlines. For instance, if you have
edit:prompt = { echo haha }, you will now have a trailing newline in the prompt, making your command appear on the next line. To fix this, simple replaceechowithprint, which does not print a trailing newline. (#354)
-
-
Breaking changes to the language core:
-
Due to the switch to persistent data structures, assignments of maps now behave as if they copy the entire container. See the section in some unique semantics for an explanation.
-
The implicit
$argsvariable is gone, as well as its friends: positional variables$0,$1, …, and the special$@shorthand for$@args. Lambdas defined without argument list ({ some code }) now behave as if they have an empty argument list. (#397)Old lambdas that rely on
$argsor its friends now must declare their arguments explicitly. For instance,fn ls { e:ls --color=auto $@ }needs to be rewritten tofn ls [@a]{ e:ls --color=auto $@a }. -
Support for using backquotes for output capture (e.g.
echo uname is `uname`) has been removed. Use parentheses instead (e.g.echo uname is (uname)). -
Backquotes are repurposed for line continuation. A backquote followed by a newline is equivalent to a space. (#417)
-
-
The signature of the
splitsbuiltin has been changed. The separator used to be an optionsepbut is now the first argument. For instance,splits &sep=: a:b:cshould now be written assplits : a:b:c.
Notable fixes and enhancements
-
Thanks to the BoltDB migration, Elvish is now a pure Go project! This allows for fully statically linked executables and easy cross compilation. (#377)
-
Enhancements to the language core:
-
New builtins functions and variables (documented in the builtin module reference):
-
New
assocanddissocbuiltin that outputs modified versions of container types. -
New
keys,has-keysandhas-valuesbuiltins (#432, #398, #407). -
A new blackhole variable
$_has been added. (#401) -
New
replacesbuiltin for replacing strings. (#463) -
New
not-eqbuiltin for inequality. -
New
dropbuiltin, mirroringtake.
-
-
Enhancements to the editor:
-
Matching algorithm used in completion is now programmable with
$edit:-matcher(#430); see documentation. -
Elvish can now able to complete arguments with variables. For instance, if you have a directory with
a.mp4anda.txt, and variable$foocontaininga,echo $foo.<Tab>now works (#446). However, the completion will expand$foointoa, which is not intended (#474). -
It is now possible to manipulate the cursor position using the experimental
$edit:-dotvariable (415). -
The default prompt now replaces
>with a red#when uid = 0.
-
-
An experimental custom listing mode (known as “narrow mode” for now) has been introduced and can be started with
edit:-narrow-read. This means that it is now to implement listing modes entirely in Elvish script.Experimental re-implementations of the several standard listing modes (location mode, history listing mode and lastcmd mode) are provided as the bundled
narrowmodule. Read its source in eval/narrow.elv for more details. -
Improvements to the daemon:
-
The daemon now quits automatically when all Elvish sessions are closed. (#419)
-
The daemon can now spawned be correctly when Elvish is not installed in
PATH.
-
-
Elvish no longer quits on SIGQUIT (usually triggered by
Ctrl-\), matching the behavior of other shells. It still prints a stack trace though, which can be useful for debugging. (#411) -
A
-compileonlyflag for the Elvish binary is added. It makes Elvish compiles a script (in memory) but does not execute it. It can be used for checking the well-formedness of programs and is useful in editor plugins. (#458)