Commit Graph
4015 Commits
Author SHA1 Message Date
Wez Furlong 38e350e9c8 ErrorKind::Unsupported is rust 1.53 and up
This isn't a hard requirement, but tracking 1.53 doesn't
feel like a burden as 1.54 is now the stable rust version.
2021-07-29 19:50:22 -07:00
Wez Furlong c867b4e079 window: fix warning when buildings tests on !macos 2021-07-29 19:44:34 -07:00
Wez Furlong 71e88a4fea conceptually allow for multiple image attachments in a cell
refs: #986
2021-07-29 19:41:52 -07:00
Wez Furlong 96f15a065c kitty img: add deflate support
Untested... it compiles!

refs: #986
2021-07-28 09:29:40 -07:00
Wez Furlong 62cc64f293 incomplete, basic implementation of kitty image protocol
This isn't complete; many of the placement options are not supported,
and the status reporting is missing in a number of cases, including
querying/probing, and shared memory objects are not supported yet.

However, this commit is sufficient to allow the kitty-png.py script
(that was copied from
https://sw.kovidgoyal.net/kitty/graphics-protocol/#a-minimal-example)
to render a PNG in the terminal.

This implementation routes the basic image display via the same
code that we use for iterm2 and sixel protocols, but it isn't
sufficient to support the rest of the placement options allowed
by the spec.

Notably, we'll need to add the concept of image placements to
the data model maintained by the terminal state and find a way
to efficiently manage placements both by id and by a viewport
range.

The renderer will need to manage separate quads for placements
and order them by z-index, and adjust the render phases so that
images can appear in the correct plane.

refs: #986
2021-07-28 09:04:52 -07:00
Wez Furlong f0996a5dc5 termwiz: add KittyImageData::load_data
refs: #986
2021-07-28 09:04:45 -07:00
Wez Furlong 7b0b042683 termwiz: parse and encode kitty image protocol
This teaches termwiz to recognize and encode the APC
sequences used by the kitty image protocol.

This doesn't include support for animations, just the
transmit, placement and delete requests.

refs: #986
2021-07-28 09:04:37 -07:00
Wez Furlong de1298f8b2 vtparse: parse APC sequences
These were parsed but swallowed. This commit expands the transitions
to be able to track the APC start, data and end and then adds
an `apc_dispatch` method to allow capturing APC sequences.

APC sequences are used in the kitty image protocol.

refs: #986
2021-07-28 09:04:28 -07:00
Wez Furlong 227e375a5f deps: cargo update 2021-07-26 08:16:03 -07:00
Wez Furlong a1f55049c5 deps: upgrade open 1.4 -> 2.0
The main difference is that it can now use `wslview` to open things
across wsl boundaries.

closes: #982
2021-07-26 08:15:02 -07:00
Wez Furlong 1c366063a3 take another crack at fixing up line wrapping attributes
This time we set the wrapped attribute when we implicitly emit
a newline and the wrap_next flag is set.

refs: #978
refs: #971
2021-07-25 09:47:29 -07:00
Wez Furlong 6345caccb0 docs: fix table 2021-07-25 09:16:55 -07:00
Wez Furlong 6ef039a726 docs: changelog and more info on custom block glyphs
closes: #584
2021-07-25 09:11:39 -07:00
Wez Furlong 1be7665c14 docs: changelog and brief docs for synchronized rendering
closes: #882
2021-07-25 08:52:12 -07:00
Wez Furlong 613bc5a4f1 docs: fix some broken links/typos 2021-07-25 08:46:10 -07:00
Wez Furlong 50c3e171c6 docs: text_blink_rate
refs: #904
2021-07-25 08:43:03 -07:00
Wez Furlong b95317241c docs: fix missing pane parameter in format-window-title-event
closes: #974
2021-07-25 08:32:50 -07:00
Wez Furlong 17a9b60e63 docs: update information about blink, which is now rendered 2021-07-25 08:28:22 -07:00
Wez Furlong bd7a2a6692 docs: changelog for #904
closes: #904
refs: #133
2021-07-25 08:25:20 -07:00
Wez Furlong aca13c6977 termwiz: fixup regression in sgr parsing for empty parameter case
I broke this with my recent csi parser changes.
2021-07-25 08:20:36 -07:00
Wez Furlong 7192fe7696 respect reverse video attributes for inferred cells
In the case where the cells vec is shorter than the line width,
we need to ensure that we render the inverse video background
color if that mode is in effect.

refs: #133
2021-07-25 08:11:49 -07:00
Wez Furlong 51cc72e299 Schedule blink invalidations
Also fixes an issue where only the first frame schedule would
take effect!  Surprised this didn't bubble up as a bug with
animated gifs already.

refs: #133
2021-07-25 08:11:00 -07:00
Autumn Lamonte e3f1d15f5d #133 unit tests 2021-07-24 23:43:30 -07:00
Autumn Lamonte d100dded23 #133 cleanup + terminalstate-level reverse video mode 2021-07-24 23:36:49 -07:00
Autumn Lamonte ce9d166733 #133 ENQ response 2021-07-24 23:36:20 -07:00
Autumn Lamonte 70544b7b26 #133 cleanup, rapid blinking text 2021-07-24 23:35:06 -07:00
Autumn Lamonte d8cacee28a #133 blinking text 50% 2021-07-24 23:29:31 -07:00
Autumn Lamonte c19f330194 #133 parse out double-width/double-height, but do not render 2021-07-24 23:20:06 -07:00
Autumn Lamonte d2e2c5dec6 #133 clean up DECREQTPARM 2021-07-24 23:19:51 -07:00
Autumn Lamonte e3cadc5782 #133 AutomaticNewline mode 2021-07-24 23:15:24 -07:00
Autumn Lamonte ad30664361 #133 Screen.reverse_video_mode + fmt fixes 2021-07-24 23:13:40 -07:00
Autumn Lamonte 31aff81884 #133 DECREQTPARM - needs cleanup 2021-07-24 23:10:52 -07:00
Autumn Lamonte d3b0881ded #133 Tab stops, reverse video. 2021-07-24 23:07:20 -07:00
Chester Liu fc2f7b83d2 tmux-cc: parse client-detached (#980)
tmux-cc: parse client-detached
2021-07-24 21:28:59 -07:00
Wez Furlong 6ddc8afc64 termwiz: recognize the XTGETTCAP DCS sequence
Parse and respond to this sequence docs can be found
https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h4-Device-Control-functions:DCS-plus-q-Pt-ST.F95

refs: https://github.com/wez/wezterm/issues/954
2021-07-24 21:06:48 -07:00
Wez Furlong 365a68dfb8 Wrap up synchronized output handling, parser changes
This commit hooks up DECRQM so that we can report that we implement
synchronized updates, and then refines the code that manages sending
data to the terminal model; the first cut at synchronized updates
was a bit simplistic, and now we make a point of "flushing" pending
actions when we start a sync point, and again as soon as we release
the sync point.

This smooths out the jaggies around the orca that I mentioned in
dcbbda7702

and while testing this, I realized that recent parser changes had
mangled processing bundled dec private mode sequences where multiple
modes were specified in the same overall escape sequence.  I've
added the missing unit test case for this and made that work again.

refs: https://github.com/wez/wezterm/issues/955
refs: https://github.com/wez/wezterm/issues/882
2021-07-24 17:01:21 -07:00
Wez Furlong a249021920 vtparse: simplify csi dispatch
This commit removes the intermediates parameter and collapses it
together with the parameters themselves.

This allows us to model DECSET (eg: `CSI ? 1 l`) correctly.
Previously this would get reported as:

```
  params: [1],
  intermediates: ['?'],
  code: 'l'
```

but since the intermediates are logically things that precede the code,
the canonical interpretation of that would be as if we'd received
`CSI 1 ? l`.

AFAICT, DECSET isn't conforming to ECMA 48 when it comes to this
sequence.

That made things a bit of a headache in the CSI parser, so what we do
now is to treat intermediates as parameters so that it is much simpler
to reason about and match in the CSI parser; we now get:

```
  params: ['?', 1],
  code: 'l',
```

refs: https://github.com/wez/wezterm/issues/955
2021-07-24 12:44:49 -07:00
Wez Furlong 86c1d50b4a WIP: improve CSI parsing fidelity
The original design of the vtparse crate was inspired by the vte
crate.  There were some assumptions about the shape of CSI sequences
that were lossy and that is posing a problem when it comes to
implementing DECRQM.

This commit improves the situation by adjusting CsiParam to be capable
of capturing all of the possible parameters as well as intermediates.

This commit isn't done; I just need to push it to transfer it to another
machine.

refs: https://github.com/wez/wezterm/issues/882
refs: https://github.com/wez/wezterm/issues/955
2021-07-24 08:34:36 -07:00
Wez Furlong c6dc677e50 preliminary support for synchronized output
This implementation doesn't include a timeout, but should be
recoverable via a SoftReset.

There's no query response either: I think I'm missing DECRQM
entirely at the moment.

refs: https://github.com/wez/wezterm/issues/882
2021-07-24 08:34:36 -07:00
Wez Furlong b13ca6fac4 window: x11: no need to complain loudly if no xsettings 2021-07-24 08:34:36 -07:00
Chester LiuandWez Furlong a7722273b0 tmux-cc: add support for layout-change (#972)
* tmux-cc: add support for layout-change

* Test for client-session-changed

* Tmux 3

* Handle visible_layout

* Apply suggestions from code review

Co-authored-by: Wez Furlong <wez@wezfurlong.org>

* Fmt
2021-07-23 21:54:35 -07:00
Wez Furlong dcbbda7702 allow images to overlay text
This commit introduces a 4th draw pass for rendering sixel and
iterm images that are attached to cells.

Previously, a cell could container either text or an image from
the perspective of the renderer.  If it had an image then the glyph
bitmap would be ignored in favor of the image.

However, that causes sixel behavior to diverge from other terminals
(https://github.com/wez/wezterm/issues/942) so we need to be render
both of these.

The simplest way to achieve this is to add a distinct set of texture
coordinates for the attached image and then add a draw pass to alpha
blend it over the glyph content.

The sixel/iterm image processing stage is also adjusted to preserve
the prior cell information and "simply" attach the image info to
the cell.  Previously, the cell would be replaced with a blank cell
with the image attached.

The result of this is that the notcurses-demo intro section can
now render the orca "enveloped in the soft glow of glyphs" rather
than caged in a black box.

Note that there are some cases where the render turns blocky but
I suspect that that is due to some other misunderstanding between
wezterm and notcurses and that we'll root cause it as a follow up.
2021-07-22 09:46:08 -07:00
Wez Furlong 61a0419f40 docs: changelog for https://github.com/wez/wezterm/issues/857
refs: https://github.com/wez/wezterm/issues/857
2021-07-22 07:52:14 -07:00
Wez Furlong 5076fe2dda term: fix rewrap issue for lines == terminal width
closes: https://github.com/wez/wezterm/issues/971
2021-07-22 07:49:18 -07:00
Wez Furlong d592696ca7 config: capture the value of WSLENV, rather than its name
Doh!
2021-07-22 07:14:03 -07:00
Wez Furlong 5434a2a581 wezterm-gui: fix over-invalidation when hovering hyperlinks
refs: #964
2021-07-21 08:58:35 -07:00
Wez Furlong 07dfccaddd window: x11: avoid extraneous title updates
Avoid setting the title again if it matches the last thing we set;
this in turn avoids receiving a property update from the window
manager to tell us that we set the title.

refs: #964 (but isn't the root cause)
2021-07-21 08:58:35 -07:00
SandroandWez Furlong 4a8c4d1c30 docs/term: add information to make it work with WSL (#936)
* docs/term: add information to make it work with WSL

* Adapt recent changes that automatically set WSLENV, add info on how to install terminfo with nixpkgs

* Apply suggestions from code review

Co-authored-by: Wez Furlong <wez@wezfurlong.org>
2021-07-21 08:05:14 -07:00
Wez Furlong 092effba04 fix background color cloning
4e99edf6f5 split the color into
thin/fat components, but overlooked copying the optional fat
part of the color.

That in turn broke sequences like:

* Set background color
* Erase to end of line

This commit teaches the sgr attribute cloning function to look
at the optional fat component.

refs: #962
2021-07-21 07:56:36 -07:00
kas 91ae9bcbaf Always provide an absolute path for the working directory to CreateProcessW() 2021-07-19 08:36:08 -07:00