1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-21 04:11:44 +03:00
Commit Graph

3431 Commits

Author SHA1 Message Date
Wez Furlong
6b92cf7539 fonts: show config error window when glyphs cannot be resolved
Keep track of the glyphs we've already advised about (until the
config is reloaded) so that we don't keep spamming the user.

refs: https://github.com/wez/wezterm/issues/559
2021-03-22 15:29:03 -07:00
Wez Furlong
f7b0ea2eb7 fonts: tune up fallback font resolution
* Check built-in fonts before asking the system for codepoint coverage
* If one of the earlier stages resolved some fonts, skip the remaining
  stages and speculatively shape what we have.  This avoids triggering
  the system font lookup for fonts that are present in the font_dirs
  or that are built-in, such as powerline symbols.

refs: https://github.com/wez/wezterm/issues/559
2021-03-22 15:03:50 -07:00
Wez Furlong
961e4ef9f7 fonts: improve FontDataHandle ordering/comparison
Don't include in-memory data in these operations
2021-03-22 14:49:00 -07:00
Wez Furlong
785645cd86 changelog for https://github.com/wez/wezterm/issues/572
closes: https://github.com/wez/wezterm/issues/572
2021-03-22 14:10:17 -07:00
dependabot[bot]
f032c5202a build(deps): bump windows from 0.4.0 to 0.5.0
Bumps [windows](https://github.com/microsoft/windows-rs) from 0.4.0 to 0.5.0.
- [Release notes](https://github.com/microsoft/windows-rs/releases)
- [Changelog](https://github.com/microsoft/windows-rs/blob/master/docs/changelog.md)
- [Commits](https://github.com/microsoft/windows-rs/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-22 13:55:43 -07:00
Wez Furlong
4d4fa35557 skip_close_confirmation_for_processes_named now also works on macos
refs: https://github.com/wez/wezterm/issues/562
2021-03-22 12:57:36 -07:00
Wez Furlong
1b7c980646 fonts: avoid querying macos fallback list multiple times 2021-03-22 12:46:58 -07:00
Wez Furlong
ad4b3b4648 add skip_close_confirmation_for_processes_named option
Currently only respected on linux.

refs: https://github.com/wez/wezterm/issues/562
2021-03-22 12:42:46 -07:00
Wez Furlong
7ace4d1efb docs: clarify how to disable per-tab close prompts
https://github.com/wez/wezterm/issues/562
2021-03-22 11:51:56 -07:00
Wez Furlong
b27e4ce2b2 keys: CMD-Q for QuitApplication is now a default on macos 2021-03-22 11:43:53 -07:00
Wez Furlong
22522dc39e render more symbol/icon/emoji at double width by default
Default `allow_square_glyphs_to_overflow_width="WhenFollowedBySpace"`,
and expand its meaning from mostly square glyphs to glyphs that are
also wider than they are tall.

refs: https://github.com/wez/wezterm/issues/565
2021-03-22 11:36:45 -07:00
Wez Furlong
4fa85e7037 gui: avoid closing pty pane when double-activating search overlay
This is another variation on dcb6fec28f

refs: #572
2021-03-22 08:35:10 -07:00
Wez Furlong
a5f4803b0b fix panic when egl doesn't have OPENGL_API
refs: #566
2021-03-21 20:51:02 -07:00
Wez Furlong
a7c9d9123b window: fix compilation warning when wayland feature disabled 2021-03-21 20:20:24 -07:00
Wez Furlong
8dbcb3e00c cargo update 2021-03-21 20:18:02 -07:00
Wez Furlong
510580bc48 docs: changelog updates
closes: https://github.com/wez/wezterm/issues/506
Refs: https://github.com/wez/wezterm/issues/546
2021-03-21 20:12:46 -07:00
Wez Furlong
70d2351b7d docs: changelog for https://github.com/wez/wezterm/issues/542
closes: https://github.com/wez/wezterm/issues/542
2021-03-21 20:05:48 -07:00
Wez Furlong
a0d39989df simplify Color data type
There's something fishy with colorspaces and blending.
This commit removes the `window::Color` type and replaces
it and the confusing array of color types exposed by the
`palette` crate with a pair of much simpler types:

`LinearRgb` - a tuple of f32 linear color components
`SrgbaPixel` - the u32 sRGBA pixel representation

This doesn't change anything about rendering, it just
makes it a bit simpler and makes the SrgbaPixel -> LinearRgb
conversion happen slightly earlier which shaves off some
ad-hoc conversions.

Refs: https://github.com/wez/wezterm/issues/544
2021-03-21 16:54:22 -07:00
Wez Furlong
59ec969a26 gui: micro-optimize some aspects of rendering
hoist the underlyine glyph retrieval out of the loop.
Precompute some color conversions (less effective until
the gamma branch is merged).

refs: https://github.com/wez/wezterm/issues/546
2021-03-21 13:40:24 -07:00
Wez Furlong
20e3d4d982 gui: use triple-buffering of vertexbuffers
The internet says that this is a recommended way to avoid stalling
when updating the vertex data.

refs: https://github.com/wez/wezterm/issues/546
2021-03-21 12:01:30 -07:00
Wez Furlong
1994a2ea2d gui: improve vertex buffer map/write/release performance
Switches from using a dynamic vertex buffer to an immutable
vertex buffer.  This feels counter-intuitive to me; the purpose
of dynamic is to sustain frequent updates, but mapping the buffer
needs to synchronize with the GPU, and if we are rapidly invalidating
the window that can stall painting by tens of milliseconds.

Switching to an immutable buffer avoids the stall and makes
quad mapping more consistently < 10ms, but its still not
ideal.

refs: https://github.com/wez/wezterm/issues/546
2021-03-21 10:28:17 -07:00
Wez Furlong
4767fcc28c windows: some minor performance improvements
* Make window invalidation more efficient by avoiding spawning a call
  that spawns a call to invalidate the window.  Just directly mark as
  invalidated.

* Suppress default background erase

* hoist the bg_color calc for quads that don't have Cells outside of
  its loop.

refs: https://github.com/wez/wezterm/issues/546
2021-03-21 10:06:43 -07:00
Wez Furlong
08797e77b5 docs: changelog for https://github.com/wez/wezterm/issues/558 2021-03-21 08:30:57 -07:00
Wez Furlong
af84d1ee7f fonts: prefer dwrote over gdi so that we can get OnDisk handles
The dwrote crate offers functions that can extract the underlying
font file name(s) from the system, so let's use those to get
OnDisk font handles and save some memory.

refs: https://github.com/wez/wezterm/issues/559
2021-03-21 01:44:41 -07:00
Wez Furlong
f3d01c4d19 windows: fix window_background_opacity
I'm not sure what exactly changed (perhaps it was a Windows updated?)
but window_background_opacity was only taking effect for windows
with no title bar.

I found that explicitly configuring a region makes transparency
work again.

refs: #553
2021-03-21 00:57:09 -07:00
Wez Furlong
2c37d2eeb5 fonts: fixup win32 build
refs: https://github.com/wez/wezterm/issues/559
2021-03-20 23:32:19 -07:00
Wez Furlong
70c4cd1a53 fonts: use Cow instead of making a Vec copy for Memory handles
This doesn't change much, just makes things slightly tidier.

refs: https://github.com/wez/wezterm/issues/559
2021-03-20 23:15:33 -07:00
Wez Furlong
eafe01e946 fonts: avoid making an in-memory copy of OnDisk font handles
In an earlier incarnation of both wezterm and freetype, FT_New_Face
would lead file descriptors into child processes because it didn't
set O_CLOEXEC.  That led to the slightly pessimistic approach of
loading the font into memory for the lifetime of the wezterm process.

With the improved fallback handling on macos, this can result in
hundreds of MB of font data being loaded, in some cases multiple
times.

Since those days, freetype now sets O_CLOEXEC and wezterm has some
logic to close other random fds, so the descriptor leaking problem
is gone and we can now let freetype manage a file handle instead
of a memory-baked font.

This reduces the memory utilization by at least 1GB in the case
that a glyphs need to be resolved from the system fallback fonts.

refs: https://github.com/wez/wezterm/issues/559
2021-03-20 23:00:53 -07:00
Wez Furlong
72f2ff850f fonts: avoid making copies of Memory font handles
refs: https://github.com/wez/wezterm/issues/559
2021-03-20 22:49:27 -07:00
Wez Furlong
5eb6a15312 macos: reduce memory utilization in font fallback case
refs: https://github.com/wez/wezterm/issues/559
2021-03-20 22:27:08 -07:00
Wez Furlong
f4a8b14a2c tidy up the error message when no fallback is found
on macos there's no guarantee that the fallback set has glyphs
for the requested range.
2021-03-20 22:09:23 -07:00
Wez Furlong
1e6754b65d fixup wt-record on darwin 2021-03-20 20:14:17 -07:00
Wez Furlong
8015791dd0 fixup initial pty dimensions to account for font/dpi size
refs: https://github.com/wez/wezterm/issues/563
2021-03-20 13:17:32 -07:00
Wez Furlong
1cf335cb45 fonts: handle bitmap-only fonts better
terminus-bold.otb reports 0 height!

Detect and force that case to go through the bitmap strike loading
code path.

Improve the size selection heuristic for bitmap strikes: previously,
we would just pick the largest bitmap and allow it to be scaled down,
which was OK for emoji fonts that just had 128px square glyphs, but
is not ok for pre-rendered pixel strikes like terminus.

Note that IncreaseFontSize works in terms of percentages only,
so using a font like this may have "gaps" when ctrl-+ or - to change
the font size.

refs: https://github.com/wez/wezterm/issues/560
2021-03-20 12:52:20 -07:00
Wez Furlong
d62d2a5133 avoid blocking forever in LocalPane::drop
I don't understand how fish ends up blocking forever in the related
issue, but it shouldn't block us too!  The price of this situation
is likely a lingering zombie child process but that seems fine.

refs: https://github.com/wez/wezterm/issues/558
2021-03-20 12:16:56 -07:00
Daniel Lemm
5805928081 docs: fix typo 2021-03-20 09:27:21 -07:00
Wez Furlong
9e6abce963 mux: adjust pty output buffering/reading
I've had a few people comment that the screen repaints stutter
more since the most recent release.

One of the main changes in that area was to increase throughput
for timg case, where a lot of data was being pumped through.

I think that, ironically, the decreased latency results in more
frequent repaints where not all of the updated screen is visible
in a full screen redraw, so it appears more janky.

This commit introduces a small 1ms delay to see if additional
output is forthcoming when parsing the data.  It will keep
delaying and accumulating until there's at least one parsed
output action to process, so there is a small constant latency
overhead added to a single character output (thread context
switch + 1ms delay).

This small delay is counter-balanced with raising the priority
of dispatching the render actions; previously we'd spawn them
at lower-than-input priority.  With the batching potential,
I think spawning them at the same priority is OK; the main
reason for the lower priority was to ensure timely ctrl-c
processing when a lot of output is being dumped to the terminal.

It's hard for me to gauge whether this fixes the reported issue,
as I've been unable to reproduce it for myself.

refs: https://github.com/wez/wezterm/issues/559
refs: https://github.com/wez/wezterm/issues/546
2021-03-19 22:12:29 -07:00
Wez Furlong
e5ae1d4769 docs: changelog for #556
refs: https://github.com/wez/wezterm/discussions/556
2021-03-19 09:29:58 -07:00
Wez Furlong
56f3e40d56 docs: changelog for #557 2021-03-19 09:21:46 -07:00
Wez Furlong
7def5f07e3 more thorough ctrl key mapping
I didn't realize that xterm inherited some additional mappings from
the X server, so this commit should make us more comformant with
xterms behavior.

Verified this by comparing `showkey -a` under both xterm and wezterm:

```
wezterm -n --config disable_default_key_bindings=true --config debug_key_events=true start -- showkey -a
```

refs: https://github.com/wez/wezterm/issues/236
refs: https://github.com/wez/wezterm/discussions/556
2021-03-19 09:18:19 -07:00
Wez Furlong
3d0f3eaeec gui: avoid doing work when WM sends spurious resize events
refs: #557
2021-03-19 08:11:39 -07:00
volgar1x
cd23515852 openSUSE support (tested on Tumbleweed 20210317) 2021-03-19 08:00:08 -07:00
Wez Furlong
c6922c001d cargo update 2021-03-18 22:08:40 -07:00
Wez Furlong
1ee4d52a1c deps: update ttf_parser 0.9 -> 0.12 2021-03-18 22:08:07 -07:00
Wez Furlong
1441462624 fonts: add explicit fallback to Apple Symbols font
This is a bit unfortunate, but necessary, because the system fallback
list contains a handful of special fonts that apple doesn't ship on
disk in ttf/otf files.

One of those is `.AppleSymbolsFB` which would normally satisfy
the symbol lookup.

This commit hard codes the "Apple Symbols" font to use instead,
which is a disk based font.  I don't know what the difference
is between it and `.AppleSymbolsFB`, but this is sufficient
to satisfy the glyph in question from the referenced issue.

refs: https://github.com/wez/wezterm/issues/506
2021-03-17 21:56:14 -07:00
Wez Furlong
57f1aa2785 fixup build to not consider termwiz tags as wezterm tags
CI got broken by the termwiz release.  This commit teaches the
various `git describe --tags` calls to filter to the wezterm
tags which all start with the year.  We're match `20*` which should
be good for the next 79 years.

I've removed the vergen dependency as there was no way to teach it
to do the equivalent matching, and it wasn't a terrible burden
to just inline the git describe call anyway.
2021-03-17 21:02:03 -07:00
Wez Furlong
ba7add140e Attach gui window invalidation to pty output event
I'm not convinced that this is 100% good, but @fanzeyi reported
some latency when using tmux to mirror two sessions.  The session
that was accepting interactive input responded quickly, but the
mirroring session was laggy.

This change connects the mux pane output event to window invalidation,
which should cause repaints to happen more often.

I couldn't reproduce the scenario above on my M1 mac, but that may
just be because M1 has dark magicks.
2021-03-17 20:20:08 -07:00
Wez Furlong
86a0f0939c x11: preserve SHIFT modifier for control characters
Basically the same thing as #516, but preserve the SHIFT
modifier for backspace and delete.

refs: #516
refs: #545
2021-03-16 18:32:49 -07:00
Wez Furlong
2ea093170c mux: avoid panic if prune_dead_windows is called indirectly
refs: #542
2021-03-15 06:38:17 -07:00
Wez Furlong
045c3d05a4 cargo update 2021-03-15 06:32:14 -07:00