1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-23 15:04:36 +03:00
Commit Graph

5717 Commits

Author SHA1 Message Date
Wez Furlong
5017d57d0a docs: freetype_pcf_long_family_names
closes: #2100
2022-06-10 06:37:01 -07:00
Wez Furlong
af815a2e1b fonts: add freetype_pcf_long_family_names option
Freetype has a compile-time feature that, when enabled, rewrites the
font names of PCF fonts to include the foundry and wide status of the
font in order to disambiguate the various versions of fonts all named
"Fixed".

That option is enabled by default in some linux distributions but not
all; it's not enabled in Fedora, for example.

When that feature is enabled it causes problems for the Terminus font as
the PCF version of the fonts are no longer resolvable via the simple
"Terminus" name but via "xos4 Terminus" instead.

wezterm builds its own version of freetype (for consistency and cross
platform support reasons), and is unaware of the choice used by the
distro.

The result of that is that fontconfig may see PCF fonts as having
different font names than how wezterm sees them.

A concrete problem is on such a system, when requesting "xos4 Terminus",
fontconfig will present a match with that name, but when wezterm opens
the font and sees that it has name "Terminus" (because of the difference
in this feature in the freetype libraries in use), wezterm will reject
that match.

This commit enables that option in the freetype library and adds a
wezterm config level option (freetype_pcf_long_family_names) that can be
used to control the underlying pcf font driver configuration.

The upshot of this is that this commit doesn't change any default
behavior, but allows users of those systems to set
`freetype_pcf_long_family_names = true` to turn that behavior on.

My personal opinion on this is that users probably shouldn't use this if
they can avoid it (and PCF fonts in general), and instead install the
OTB version of the Terminus font, which doesn't have this legacy baggage
associated with it!

refs: https://github.com/wez/wezterm/issues/2100
2022-06-09 20:09:47 -07:00
Wez Furlong
b59b51ee2a windows: default allow_win32_input_mode=true
refs: #2098
refs: #2009
refs: #1904
closes: #1509
2022-06-09 07:26:53 -07:00
Wez Furlong
f601c775e6 x11: Xkb is already in the mandatory list
so remove it from the optional extensions list
2022-06-08 08:43:32 -07:00
Wez Furlong
d2faa96271 mux: restore same-domain check for cwd when spawning tabs
I think this got lost when this mux function was refactored into
this location from elsewhere.

refs: #2092
2022-06-08 07:56:00 -07:00
Wez Furlong
d85b7bf3b9 win32: add extended/enhanced key concept for win32 input mode
refs: https://github.com/wez/wezterm/issues/2009
refs: https://github.com/microsoft/terminal/issues/13134#issuecomment-1148000328
2022-06-08 07:41:19 -07:00
Wez Furlong
a0e2a805d9 deps: notify -> 5.0.0-pre.15
This allows moving past a number of outdated deps, but importantly,
allows updating miow to a version that has the correct memory layout
for SocketAddr, and satisfies a dependabot alert.
2022-06-07 23:34:58 -07:00
Wez Furlong
7abc46208d deps: migrate from ratelimit_meter -> governor
This appeases some dependabot warnings regarding the use of
an old version of parking_lot that has some unsoundness issues.

ratelimit_meter is frozen and is succeeded by governor which has
a mostly similar API.
2022-06-07 22:55:01 -07:00
Algus Dark
a323935bb6 docs: fix key tables example mismatched curly braces 2022-06-06 22:16:02 -07:00
Wez Furlong
4776c8d9d9 deps: cargo update 2022-06-05 22:31:26 -07:00
Wez Furlong
e7258e0e03 fonts: fix automatic bold synthesis
For fonts like Lucida Console on Windows which do not have a bold
variant, we were not synthesizing bold.

The reason was that the config-level "make bold" logic works by adding
200 to the weight which takes normal -> demibold, but the bold synthesis
logic is enabled only for bold and higher.

This commit changes the threshold for synthesis to demibold or higher.

refs: https://github.com/wez/wezterm/issues/2074
2022-06-05 06:35:31 -07:00
Wez Furlong
9b6329b454 x11: more hacks to deal with missing CONFIGURE_NOTIFY
This one triggers a short timer when a focus event is received;
when that timer fires, we invalidate the geometry and repaint.

refs: #2063
refs: #1992
2022-06-04 06:29:33 -07:00
Wez Furlong
da59a22297 x11: subscribe to Present extension configure notify events
The hope here is that the nvidia-specific resize issue might have
a workaround if it is emitting some other events that we were
previously not listening for.

This commit optionally enables the Present extension and listens
for its version of CONFIGURE_NOTIFY, routing it through the same
logic as the base CONFIGURE_NOTIFY event.

On my AMD hardware under Gnome, I see something like:

```
18:04:26.476  TRACE  window::os::x11::window > Present::ConfigureNotify: width 1168 -> 1180, height 858 -> 873, dpi 124.7998046875 -> 124.7998046875
18:04:26.478  TRACE  window::os::x11::window > Ignoring X::ConfigureNotify (1180x873 dpi=124.7998046875) because width,height,dpi are unchanged
```

with the Present event firing before the X event.

Let's see how this goes.

refs: #2063
refs: #1992
2022-06-03 18:08:51 -07:00
Wez Furlong
402e5b7382 background: round down fractional pixels when tiling 2022-06-03 09:28:24 -07:00
Wez Furlong
ead3d4a188 avoid invalidating line seqno when applying hyperlinks
Return the the appropriate seqno from the original line
2022-06-03 08:40:51 -07:00
Wez Furlong
35f14ec34c box model: allow for eased colors to be set
I did an ad-hoc test where I set the new tab button background to
an Animated value and saw that it eased in and out.

However, this commit doesn't make anything use this yet.
2022-06-03 06:58:57 -07:00
Wez Furlong
f60e39b4c3 gui: speculative fix for #2068
refs: https://github.com/wez/wezterm/issues/2068
2022-06-02 21:06:19 -07:00
Wez Furlong
ff32ae804e manual fuzzing with cat /dev/random
refs: https://github.com/wez/wezterm/issues/2067
2022-06-02 12:03:33 -07:00
Wez Furlong
81bac8b3f2 x11: trace expose events. invalidate geometry in some cases
Main idea here is to add expose events to the trace so that we
can get a sense of whether those are emitted when a WM isn't delivering
CONFIGURE_NOTIFY consistently.

If the exposed area is bigger than what we think the window is,
then we mark geometry as unsure.

I'm considering always marking as unsure for an expose event,
or at least, adding a config option to enable that, as a way
to workaround this situation.

refs: https://github.com/wez/wezterm/issues/2063
refs: https://github.com/wez/wezterm/issues/1992
2022-06-02 09:52:36 -07:00
Wez Furlong
c3b1aa72d3 x11: use focus change as a signal that the size may have changed
From the logs shared in https://github.com/wez/wezterm/issues/2063#issuecomment-1144957250
it looks like focus change events can correlate with the WM tiling
windows, even though the WM doesn't send a CONFIGURE_NOTIFY event.

So let's set a flag to query the geometry when the focus changes

refs: https://github.com/wez/wezterm/issues/2063
refs: https://github.com/wez/wezterm/issues/1992
2022-06-02 08:00:55 -07:00
Wez Furlong
a0ad3dd378 gui: move ease/interpolation into shader
This is prep for future work where I'll be moving more of the main
monospace rendering into the box model code and factoring out
this aspect of animation.
2022-06-02 07:10:57 -07:00
Wez Furlong
9270e3b41e docs: fix anim gif + speed docs 2022-06-02 05:40:58 -07:00
Wez Furlong
3dfb570162 background: round down fractional y offsets
Otherwise there is a chance that we'll end up with a 1-pixel
transparent gap between tiled textures
2022-06-01 20:44:27 -07:00
Wez Furlong
32e53a7834 docs: update config file resolution docs
refs: https://github.com/wez/wezterm/discussions/2061
2022-06-01 17:31:01 -07:00
Wez Furlong
749db1435d background: avoid allocating empty layers
Only increment the layer index if we allocated any quads into it
2022-06-01 12:07:14 -07:00
Wez Furlong
1ae72bccae term: avoid fragmenting version/attribute query responses
Keep them in a single write call to minimize the chances of issues
like https://github.com/wez/wezterm/issues/2060
2022-06-01 07:56:41 -07:00
Wez Furlong
2b083cc131 background: cache computed gradient images
Avoid recomputing on each config change/reload.
2022-06-01 07:29:24 -07:00
Wez Furlong
167127c14b disco: reduce info -> debug for gui-sock publish 2022-06-01 05:59:06 -07:00
Wez Furlong
a648d6d8d2 windows: reduce EGL->WGL fallback warning to trace 2022-06-01 05:57:59 -07:00
Wez Furlong
4ba0d4b50b docs: fix typo in changelog 2022-06-01 05:24:05 -07:00
Wez Furlong
70c35790ea docs: tweak the background docs to be more bullets, less wall of text 2022-06-01 05:21:04 -07:00
Wez Furlong
9db5368926 docs: finish the unfinished thought 2022-05-31 23:26:17 -07:00
Wez Furlong
d9f54a7c41 docs for new background config 2022-05-31 23:20:11 -07:00
Wez Furlong
5f56b96dd2 background: allow repeat to mirror 2022-05-31 21:49:12 -07:00
Wez Furlong
590bcf2f75 background: implement offsets and alignment 2022-05-31 19:39:28 -07:00
Wez Furlong
40afbf1ec9 sync color schemes with upstream
Sync with 021a00ba1e532e34071a48f999dfa302072e9c43 of https://github.com/mbadolato/iTerm2-Color-Schemes

closes: #2013
2022-05-31 18:06:51 -07:00
Wez Furlong
1360e13f24 background: use Dimension for background size 2022-05-31 12:36:47 -07:00
Wez Furlong
040cd19f88 background: allow specifying the repeat interval
Useful if you want to add smaller items to your background layers
every so often; you can specify the distance between them and make
it independent of the item height.
2022-05-31 12:11:27 -07:00
Wez Furlong
e85258a212 background: allow specifying a solid color layer
The color can have alpha and blend with other layers.
This is helpful if your image has fully transparent portions
and you want to explicitly place a color in there.
2022-05-31 08:47:28 -07:00
Wez Furlong
4cb75c154f background: allow specifying the animation speed for images
The `File` variant for background layers may now be an object
that specifes a speed factor.  That factor is applied to the
animation frame durations in the loaded image, allowing the
playback rate to be adjusted.
2022-05-31 07:32:05 -07:00
Wez Furlong
3ef533e858 background: respect alpha in background images 2022-05-30 08:51:48 -07:00
Wez Furlong
7738f89381 background: use the actual sprite width
not the width of the full texture
2022-05-30 08:05:26 -07:00
Wez Furlong
303b908f9b fmt 2022-05-30 07:24:13 -07:00
Wez Furlong
62532704c2 background: implement attachment scrolling and parallax!
```lua
return {
  background = {
    {
      source = {File="/home/wez/Downloads/grey-bricks.png"},
      -- attachment = "Scroll",
      attachment = {Parallax=0.1},
      hsb = { brightness = 0.3, },
    },
  },
}
```
2022-05-30 07:20:14 -07:00
Wez Furlong
08d2ec67dc background: refactor where we trigger background painting
moving it so that we have access to the full set of positioned panes
in a subsequent commit.
2022-05-30 07:20:14 -07:00
Wez Furlong
27511c59ef background: implement scaling and repeating options 2022-05-30 07:20:14 -07:00
Wez Furlong
77b2674f6c render multiple backgrounds with alpha
Adjusts the background rendering logic so that we now allocate
a render layer for each defined background layer. This allows
their individual opacity value to multiple and blend together.

As part of this, I noticed that the big jpegs I was using could
take 400ms or more to load, so I added a basic cache to avoid
loading the same image multiple times around a config reload.
2022-05-30 07:20:14 -07:00
Wez Furlong
5d44ed6f85 notionally allow multiple background image layers
This adds some types that will enable richer background images.

* Can specify multiple layers
* Each layer can select from image files or gradient definitions
* Layers have additional properties to specify positioning, scaling,
  tiling and whether they scroll with the viewport.

None of the additional properties are hooked up yet.
2022-05-30 07:20:14 -07:00
dependabot[bot]
a9612bc613 build(deps): bump crazy-max/ghaction-github-pages from 2 to 3
Bumps [crazy-max/ghaction-github-pages](https://github.com/crazy-max/ghaction-github-pages) from 2 to 3.
- [Release notes](https://github.com/crazy-max/ghaction-github-pages/releases)
- [Changelog](https://github.com/crazy-max/ghaction-github-pages/blob/dev/CHANGELOG.md)
- [Commits](https://github.com/crazy-max/ghaction-github-pages/compare/v2...v3)

---
updated-dependencies:
- dependency-name: crazy-max/ghaction-github-pages
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-29 20:58:00 -07:00
kumattau
c591217cb7 Use clap::derive::Parser::parse() to fix deprecated warning 2022-05-29 09:54:38 -07:00