The main benefits of this change are:
1) It uses a hermetic "home" directory with a known command and location
history. Which means it no longer depends on the interactive history
and directory layout of the person creating the ttyshot. Which also
means it no longer leaks the private history of anyone creating a
ttyshot. This produces reproducible results when updating ttyshots.
2) The user no longer has to augment the ttyshot by manually adding the
output of the commands to the generated HTML file. A process that is
error prone. The output of the commands that generate the ttyshot is
now captured and automatically included in the resulting HTML.
3) It makes it trivial to recreate every ttyshot. Simply execute these
commands:
```
make ttyshot
for f [website/ttyshot/**.spec] { put $f; ./ttyshot $f }
```
4) It makes it easy to introduce new "ttyshot" images by creating a
shell session "spec" file. This makes it easy to replace the existing
"```elvish-transcript...```" examples with ttyshots in order to
ensure a consistent representation and visual consistency with the
transcripts that are currently generated as ttyshots.
The downside of this change is the introduction of a dependency on the
Tmux application. But that seems reasonable since Tmux is a mature
application available on Linux, macOS, BSD, and probably every other
UNIX like OS we care about. Note that generating the Elvish
documentation already depends on similar apps such as Pandoc.
Related #1459
There is no need to enumerate namespaces separately, since namespaces are also
variables. The only exceptions are "e:" and "E:", which are handled as special
cases now.
It turns out that the "small word" abbreviation mechanism I added isn't
really what I, or most users, want. What users really want, at least
most of the time, is the Fish shell abbreviation behavior of expanding
an abbreviation only in the command head position.
Resolves#1472
Qualified imports of pkg/ui outnumber unqualified (82 to 1). Improve
consistency, and clarity, by changing the dot (unqualified) imports of
that package symbols to qualified.
Qualified imports of pkg/tt outnumber unqualified (27 to 24). Improve
consistency, and clarity, by changing the dot (unqualified) imports of
that package symbols to qualified.
The PureEvaler abstraction made things unnecessarily complex; it's better to
just create a real Evaler for tests is pretty.
The Evaler has a new ReplaceBuiltin method to make it easier to construct the
expected test result.
This was extracted from https://github.com/elves/elvish/pull/1326. It
augments that change by honoring $E:PATHEXT and some other
minor improvements. This matches the behavior of the Go stdlib
os/exec.LookPath() function that is used to decide if what has been typed
(in a non-completion context) represents an external command.
cmp.Diff panics when comparing a struct that has unexported fields and no String
or Equal method, so change some structs to either export all their fields or
have an Equal method.
This fixes#1136.
- Introduce nodePath to store the complete path to the leaf node.
- Introduce a nodesMatcher abstraction to do pattern matching on nodePath.
Parse tree matching previously requires deeply nested if statements to walk
multiple levels of the tree and (optionally) check the property of nodes. These
are replaced by a single "if np.match(...)", with a single level of nesting.
- Don't require creating a Getopt object in the API.
- Add a new Parse function, and rename the existing method to Complete.
- Add an Unknown field to Option to indicate unknown options.
- Rewrite the tests.
- Numerous stylistic changes.