1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-28 01:06:37 +03:00
Commit Graph

2789 Commits

Author SHA1 Message Date
Wez Furlong
b860c9dbda termwiz: avoid panic for some malformed escapes 2020-11-06 13:59:04 -08:00
Wez Furlong
1dfc06febb docs: changelog for the last couple of fixes 2020-11-03 09:10:55 -08:00
Wez Furlong
cfef4fd0ca wezterm: adjust pixel width and height when dragging splits
The drag would update the cell dimensions but not the pixel dimensions,
which results in weird image scaling.

refs: #312
2020-11-02 19:56:46 -08:00
Wez Furlong
7fb22d6968 term: correct cursor position after imgcat
I've had a FIXME in here for a while to check the positioning,
but never got around to it.

The onefetch folks have an app that does care about this,
so it's time to resolve it!

This commit adjusts the cursor position for the iterm case
(not the sixel case), and results in both:

running in xterm:

```
onefetch --image ~/Downloads/squirrel.png
```

running in wezterm:

```
TERM_PROGRAM=iTerm.app onefetch --image ~/Downloads/squirrel.png --image-backend=iterm
```

```
onefetch --image ~/Downloads/squirrel.png --image-backend=sixel
```

showing consistent positioning.

refs: https://github.com/wez/wezterm/issues/317
refs: https://github.com/o2sh/onefetch/pull/305
2020-11-02 18:06:05 -08:00
Wez Furlong
500bf1b376 docs: note about #316
refs: #316
2020-11-01 10:36:33 -08:00
Wez Furlong
403d002d0a window: fix potential crash with multiple egl windows on windows
I didn't actually see this crash, but the same potential problem
was present, so adjust the code as per 9712d4d03c

refs: #316
2020-11-01 10:28:17 -08:00
Wez Furlong
9712d4d03c window: fix crash with multiple egl windows on macos
This is basically the same issue as
70fc76a040 but on macOS.   Now that we're
using EGL in more places, the same sort of check needs to used in more
places!

Will need to do the same on Windows in a follow-up commit.

refs: #316
2020-11-01 10:18:40 -08:00
Wez Furlong
bb49ecca98 docs: update for 20201031-154415-9614e117 release 2020-10-31 15:51:08 -07:00
Wez Furlong
9614e117e0 term: restore original resize behavior on Windows
This reverts to the original resize behavior of padding out
the display when resizing taller, but only for Windows systems.

More explanation in the comments in the code.

refs: #138
2020-10-31 11:58:15 -07:00
Wez Furlong
b239801085 wezterm: fixup wezterm ssh host
Needed to re-order a couple of things to match recent changes.

Also: don't hard fail if the ssh server rejects a setenv request,
just log the error instead.
2020-10-31 11:45:30 -07:00
Wez Furlong
5619eb718c wezterm: default inactive_pane_hsb to dim/desaturate
Let's make the suggested config in the docs the default
and dim/desaturate inactive panes slightly.
2020-10-30 23:12:35 -07:00
Wez Furlong
7a934ae63d docs: clarify color scheme search path
refs: https://github.com/wez/wezterm/issues/313
2020-10-30 22:56:32 -07:00
Wez Furlong
6dcf921dc3 docs: remove note about toml config support
This hasn't been supported in the past couple of releases
2020-10-30 22:37:49 -07:00
Wez Furlong
e2605d6b21 docs: clarify how to upgrade brew nightly 2020-10-30 22:36:11 -07:00
Wez Furlong
a725dd3050 ci: add mux-server to brew tap install 2020-10-30 22:20:02 -07:00
Wez Furlong
0547fbb549 ci: set release as pre-release when tagging
also looks like I missed updating the source tarball
generation step in a prior adjustment.
2020-10-30 22:09:58 -07:00
Wez Furlong
863a64cea2 docs: reorder and refine changelog items 2020-10-30 21:09:35 -07:00
Wez Furlong
ab0a4fc2d2 mux: fix initial creation of pid file in mux server
We need to create the directory structure that we want to place
the pid file into.
2020-10-29 21:07:49 -07:00
Jun Wu
ebd4f4aa06 lineedit: add a way to render previews
Make it possible to implement rendering previews in new lines, seen in
nodejs [1]. The preview is cleared when the line is accepted (Enter)
or canceled (Ctrl+C).

[1]: https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V12.md#repl-previews
2020-10-29 08:56:30 -07:00
Wez Furlong
75ce0fc822 term: improve cursor/viewport positioning on resize
This seems to make our resize behavior a bit nicer and more
consistent with eg: xterm.

Previously we'd consider the previously existing scrollback
as immutable and prefer to add excess blank lines of padding
when making the window taller.

In practice that meant that content would scroll back when
making the window taller, which is annoying.

This commit removes that constraint and instead will prefer
to maintain the cursor position relative to the top of the
viewport when the size changes.

refs: #138
2020-10-28 22:50:50 -07:00
Wez Furlong
92bdc4a3b0 Revert "window: alternative shadow/ghost/macos fix"
This reverts commit f2b504ee1f9a607fe8965e96b659bca282147672;
we prefer the overall snappier perf from not having a shadow.

refs: #310
2020-10-28 17:55:15 -07:00
Wez Furlong
f2b504ee1f window: alternative shadow/ghost/macos fix
This one invalidates the shadow when we invalidate the window,
so we should get to keep the shadow and lose the ghosts.

refs: #310
2020-10-28 16:08:33 -07:00
Wez Furlong
e3100c937f window: maybe fix ghostly artifacts on macos
Not 100% sure that this is it, but it seems much less likely that
artifacts will appear in conjunction with transparency when the window
shadow effect is disabled; I didn't see the ghosting with this disabled,
but I sometimes dididn't see it with it enabled, so I'm not sure that we
have a 100% reliable reproduction, and thus am not sure that this is a
fix.

I found mention of disabling the shadow in some example code on
stackoverflow when I was first researching this, but it wasn't supplied
with an explanation. Perhaps this is why?

Longer term we might want to be smarter about turning off the shadow
only when the opacity is != 1.0, but at the moment the window layer
can't see the config, so let's just default it off for the moment
until we see if it does the trick.

refs: #310
2020-10-28 14:08:04 -07:00
Wez Furlong
3808cf3f58 wezterm: fixup overall background color
When padding was set, it was being overwritten by black whitespace
unconditionally.  This fixes that.

refs: #309
2020-10-27 22:09:03 -07:00
Wez Furlong
5b9c86d836 colors: set cursor border to bg in the color schemes
This avoids having a green (by default) border around the cursor.
The dynamic color escape sequences have been updated to also
change the border color when the cursor background color is changed.
2020-10-27 09:17:20 -07:00
Wez Furlong
b9bdacfc58 docs: fix a couple of links 2020-10-27 09:02:09 -07:00
Wez Furlong
42aeb6f11b wezterm: retry initial texture allocation
A consequence of reducing the initial texture size is that for
larger starting font sizes it isn't big enough.  We need to make
a couple of passes to determine the required size, so that's
what this commit does.

refs: #307
2020-10-25 16:09:47 -07:00
Wez Furlong
114c67d338 docs: mention VRAM and image improvements 2020-10-25 12:29:20 -07:00
Wez Furlong
f6fcf2e2f6 docs: discuss styling inactive panes
closes: #297
2020-10-25 12:17:25 -07:00
Wez Furlong
dab2dd5025 term: cache recently decoded images
This commit introduces a small, bounded, LRU cache for recently
decoded images.

This allows the same image ID to be used in the cache that the
same image bits are repeatedly sent to the terminal.

This is advantageous because it reduces the amount of texture
space required by the gui layer.
2020-10-25 11:59:44 -07:00
Wez Furlong
198c40103b wezterm: fix iterm2/sixel images rendering in wrong pane
The quad selected for the image cells didn't account for
the pane origin.
2020-10-25 10:30:15 -07:00
Wez Furlong
f8c35f191b wezterm: add env bootstrap to mux server, too 2020-10-24 23:33:31 -07:00
Wez Furlong
83d604fe29 wezterm: .desktop launches wezterm
I changed this to `wezterm-gui` thinking it would be a hair more
efficient, but it makes it difficult to access the cli side of
things from the appimage.
2020-10-24 23:25:48 -07:00
Wez Furlong
21dbeb6f83 wezterm: fixup APPIMAGE environment consistently
Need to apply the same logic in wezterm-gui as we do
in the wezterm-cli.
2020-10-24 23:21:03 -07:00
Wez Furlong
ea0d8d6f11 wezterm-font: remove font-kit dep
This wasn't used by anything and the version was getting pretty stale.
Upgrading is awkward because newer versions pull in an incompatible
freetype library version.
2020-10-24 22:01:00 -07:00
Wez Furlong
284a4ebfbb window: fix mouse wheel reporting on Windows
Wheel events wouldn't get reported to eg: vim in wsl if the
window's X position was larger than the window width due to
mouse wheel messages being reported with screen coordinates
rather than client coordinates.

This commit addresses that.
2020-10-24 21:41:11 -07:00
Wez Furlong
89257c73bb wezterm: a few more wezterm-gui fixups
These parts of packaging are likely sensitive to the change also
2020-10-24 17:17:45 -07:00
Wez Furlong
b2dcc233c0 wezterm: improve error reporting in imgcat
This just includes the filename in the error message
if we're unable to read a file.
2020-10-24 17:07:19 -07:00
Wez Furlong
7d843c6b24 wezterm: fixup win32 build for wezterm-gui changes
refs: #301
2020-10-24 17:00:07 -07:00
Wez Furlong
2ec12b5426 wezterm: fixup packaging for wezterm-gui split
refs: #301
2020-10-24 16:54:36 -07:00
Wez Furlong
442c9a26d1 wezterm-gui: partial revert of 91ce0b77ea
Apparently macOS/ANGLE doesn't like the shader changes, so
roll them back.

refs: #292
2020-10-24 16:47:38 -07:00
Wez Furlong
7e8c5a06bb split gui into wezterm-gui executable
This commit moves a bunch of stuff around such that `wezterm` is now a
lighter-weight executable that knows how to spawn the gui, talk to
the mux or emit some escape sequences for imgcat.

The gui portion has been moved into `wezterm-gui`, a separate executable
that doesn't know about the CLI or imgcat functionality.

Importantly, `wezterm.exe` is no longer a window subsystem executable
on windows, which makes interactions such as `wezterm -h` feel more
natural when spawned from `cmd`, and should allow
`type foo.png | wezterm imgcat` to work as expected.

That said, I've only tested this on linux so far, and there's a good
chance that something mac or windows specific is broken by this
change and will need fixing up.

refs: #301
2020-10-24 16:40:15 -07:00
Wez Furlong
52908712c6 wezterm: add excess padding for image protocols
When allocating space in the texture atlas, we typically use
a small padding to avoid accidentally interpolating textures
into glyphs.

When it comes to rendering images via iterm2 or sixel image
protocols, the image emitted by the user may not exactly fill
the cell dimensions, and due to the how the shader works to
apply those textures we could end up revealing nearby images
in the texture when displaying an unrelated image.

This commit adjusts the texture atlas allocation when making
space for image protocol textures; excess padding based on
an overestimate of the cell dimensions is added to the right
and bottom of the image, guaranteeing that that border will
be filled with transparent pixels.

This is a bit wasteful of texture space, but isn't egregiously
bad and is easy to reason about and makes things look less
janky.

refs: #292
2020-10-24 12:46:49 -07:00
Wez Furlong
e2bf111426 wezterm: fix texture coordinates math for image protocols
There was an integer conversion happening when taking the
per-cell image texture coordinates and applying them to the
texture atlas image coordinates.

This commit replaces that math with floating point and corrects
the visual artifacts within squirrel.png.

refs: #292
2020-10-24 11:13:08 -07:00
Wez Furlong
91ce0b77ea wezterm: tidy up shader a bit
More properly annotate the types of the data used in the shaders.
Make the declarations more consistent with each other.
2020-10-24 10:42:23 -07:00
Wez Furlong
b49b82ae89 wezterm: add a linear scaling sampler for graphics
The fragment shader was set to use nearest texel sampling
because that made for sharper lines when rendering the
cursor bar or outlines.

This commit adds a supplemental sampler over the same
texture that is set to merge nearby texels.  We now
use this sampler for the background image and cells
marked as having full color textures (eg: emoji,
image protocol).

This makes the window background image look better
when it is scaled.  I'm not 100% sure about image
protocol cells, but I'm looking into that in general
at the moment.
2020-10-24 10:01:10 -07:00
Wez Furlong
7f82f333f1 wezterm: revise opacity configuration
This commit revises the opacity configuration to make it more
consistently applied.

* `window_background_opacity` controls the overall window capacity,
  whether a background image is present or not.
* When a background image is present, or if the window is transparent,
  then text whose background color is the default background is
  changed to have a fully transparent background.
* `text_background_opacity` controls the alpha channel value for
  text whose background color is NOT the default background.
  It defaults to 1.0 (fully opaque), but can be set to be
  transparent by setting it to a number between 0.0 and 1.0.
* The inactive pane hue, saturation, brightness multipliers
  have been factored out into their own struct which changes
  that set of options to:

```lua
return {
  inactive_pane_hsb = {
    hue = 1.0,
    saturation = 1.0,
    brightness = 1.0,
  },
}
```

* `window_background_image_hsb` is a new option that can apply
  a hue, saturation, brightness transformation to a background
  image.  This is primarily useful to make a background image
  darker:

```lua
return {
  window_background_image = "/some/pic.png",
  window_background_image_hsb = {
    brightness = 0.3,
  },
}
```

refs: #302
refs: #297
2020-10-23 23:16:00 -07:00
Wez Furlong
18c2c6838a wezterm: tidy up atlas reallocation code path
refs: #306
2020-10-23 18:00:11 -07:00
Wez Furlong
f4066747d2 wezterm: improve texture atlas allocation
This commit uses the guillotine algorithm to assign rectangles,
which is superior to the dumb algorithm previously in use.

In addition, in the first pass of painting, if we get a texture
space error, we clear the atlas and try again without increasing
it size, which should serve as the ultimate defrag.

Subsequent passes will cause the texture to grow if needed.

refs: #306
2020-10-23 13:57:58 -07:00
Wez Furlong
e665bdb139 wezterm: reduce initial texture atlas size
Reduce the initial atlas size from 4096*4096*4 to
128*128*4.

Fixup an issue with rendering image cells that would
prevent the render from propagating a texture space
error and keep wezterm busy.

refs: #306
refs: #292
2020-10-23 09:07:51 -07:00