During CI (specifically, urbit-tests), slogs and printf output would
get interleaved, sometimes intermingling, mangling the resulting
output.
Best guess is this happens because of something weird we're doing with
regards to pushing output. Additional scatter-shot fflush calls solve
this. The fix herein also solves this. Unclear why, considering this
commit should result in identical behavior for the -t case.
Here be dragons.
When uv_spawn creates a process and any standard fds are set to UV_INHERIT_FD,
it ignores UV_PROCESS_WINDOWS_HIDE flags, and worker console pops up in -d mode.
We weren't accounting for the cursor column when storing output, nor
accounting for styled contents properly.
See also a8de23ca9 for the equivalent change in Vere.
We were storing the contents of the bottom line, but not accounting for
style/escape characters when overwriting parts of it with new contents.
Here, we switch to storing a +stub noun in state instead, letting us
rely on the stdlib for the overwriting logic.
This comes at the cost of having to re-render the stub into an escape
sequence on every restore, but that has yet to prove itself slow enough
to care about.
+wail, for overwriting part of a stub, starting at the given index,
extending it using the specified character if the index is past the end
of the stub.
+pact, for merging sequential stub sections with identical style.
Separates blit rendering for logic for -t into a separate function.
Ensures we don't overwrite any rendered content and always put newlines
in between distinct pieces of output.
Also stops storing the bottom line of output in the -t case, since it
won't get re-rendered anyway.
Hopefully this makes CI output look nice again.
Use them for all zero-argument sequences, remove unused ones, and make
their naming consistent.
Also removes old, commented code around input sequences.
In other words, don't issue the ANSI escape sequence for saving the
cursor position at the start of a printf hijack sequence. Instead
trust this was already done when the cursor position was last changes
by a blit.
Implements tasks for creating and deleting new sessions, and allows
terminal handler agents to distinguish between sessions.
Includes bits of preparation in drum to more fully support multiple
distinct sessions, but doesn't get it all the way there just yet.
Gall would send %onto gifts to notify about app updates and update
failures. This would end up in dill, which printed some appropriate
text.
Here, we make gall responsible for doing this printing itself (by
having it explicitly ask dill to print some tape/tank), instead of
relying on the receiving end of some bespoke notification protocol.
This comes with the caveat that this specific mouse reporting mode
(which should only report clicks of the primary button) doesn't
actually seem to be supported by most terminal emulators, even though
it precedes the more complex reporting modes.
(Enabling a more complex reporting mode instead would also capture
scroll events, which interferes with expected behavior while in tmux.)
New blit logic already stopped assuming the bottom line based on %nel
blits, instead looking at cursor position to determine if something
was getting drawn to the bottom of the screen or not.
Here, we stop overwriting the bottom line entirely (except for the
spinner), instead inserting the trace/slog directly above the bottom
line on-screen, without overwriting anything.
Side-effect of this is that trailing newlines are always there, so we
can stop including them explicitly.
Separately from deriveNoun, which gives you an entire instance. Having
access to these lets you call out to the auto-generated conversion
logic when writing custom code for it.
The previous version allowed for redundant values (both [%bac ~] and
[%key ~ %bac ~] for example), had an odd constraint in @cF, and relied
unnecessarily on $<.
Also rewords some of the belt and blit descriptions.
Results in slightly better behavior... but it still breaks on dev
auto-refresh?
Also no longer does the ''<->'default' transform for the default session
identification in state, instead always using the empty string.
Previously, we relied on foolish hacks, like [%met %bac], to send
"special" keystrokes with modifiers.
This updates the belt type to have %key, which represents a single
keystroke, with any combination of modifier keys.
Note that this has overlap with %txt to some extent. [%key ~ 'a'] should
be considered equivalent and preferred to [%txt 'a' ~], but updating
existing usage is left to a later commit.