From what I understand, we shouldn't need both `\x1B[2J` and `\x1B[3J`
sequences to clear everything, but xterm.js would not correctly clear
the visible region with only `\x1B[3J`. So, we have both.
filesystem.readdir() can throw, which previously would crash Phoenix and
leave the terminal unresponsive. This change makes it return no results
instead.
Having the parent app send us arbitrary config values was a holdover
from when phoenix was an embedded iframe and not a separate app. It led
to a security issue previously. Let's only take the auth parameters
since we can't get those otherwise, and they're safe to read.
Everything else should be available in our own URL params.
I tried implementing --source=foo too, but was bumping into weird
behaviour with isomorphic-git, so I've removed that for now. Eventually
we'll want it, but it seems fairly niche.
Specifically, we previously didn't resolve short commit hashes into the
full ones.
These functions provide a single place to later add more ways of
selection a commit, such as `HEAD~1`.
Previously, this:
```sh
> rm deleted.txt
> git add deleted.txt
```
...would unhelpfully complain that deleted.txt cannot be found. Now, it
records the deleted file to the index, just as canonical git does.
These allow the user to force color on or off. The chalk library is used
for the output, because it's already used elsewhere in Puter and seems
like a good choice.
Ideally, the default will be based on whether stdout is a tty, but Puter
doesn't yet have that concept, so we just default to color.
For now, the authentication is by --username and --password options,
which obviously is not good because the password is visible. But doing
it in a nicer way requires features that Phoenix or Puter are currently
missing.
I prefer the other names, but being able to type `{ dir, gitdir }` is
shorter and a lot less error-prone than `{ dir: repository_dir, gitdir:
git_dir }`.
A command can optionally define a `completer(args)` function. It takes
an array of strings for the current arguments, and returns an array of
completion results for the last argument.
Includes a few completers:
- alarm:info/clear/inspect completes the first argument as an alarm id
or short_id
- script:run completes the first argument as a script name
- params:get/set completes the first argument as a parameter name