1
1
mirror of https://github.com/wez/wezterm.git synced 2024-09-21 03:39:16 +03:00
Commit Graph

3180 Commits

Author SHA1 Message Date
Wez Furlong
5eb7634403 gui: factor image cell rendering into its own function 2021-02-22 19:17:24 -08:00
Wez Furlong
ee17e4e174 Add shaper post-processing function
This function is intended to deal with certain kinds of ligatures
and certain combining sequences that don't have corresponding glyphs.

It isn't hooked up to the gui yet, but does have unit tests that
are probably mostly correct.

refs: https://github.com/wez/wezterm/issues/478
2021-02-22 19:17:24 -08:00
Wez Furlong
1bbe594354 allow specifiying font size as an integer
This trips me up every so often, so it seems worth making this
a bit easier.
2021-02-22 12:07:11 -08:00
Wez Furlong
c84141bf5e cargo update 2021-02-22 00:09:01 -08:00
Wez Furlong
2ffcd08eda config: remove hard coded fallback fonts on macos and windows
We don't need these now that we know how to ask the system to
resolve fallbacks for specific glyphs.
2021-02-20 23:41:14 -08:00
Wez Furlong
7a16e71e07 Add ResetFontAndWindowSize key assignment
closes: https://github.com/wez/wezterm/issues/480
2021-02-20 21:50:20 -08:00
Wez Furlong
a91c0a5d98 fixup render for macos
Apparently we need to enable srgb for all three stages in order
to output correct color.

refs: #491
2021-02-20 20:32:30 -08:00
Wez Furlong
82fc53d736 rasterize: refine blending math
Refine the colorization logic to make it more of a blending operation.
Previously, we were relying on opengl to carry out blending between
layers on our behalf, but that wasn't perfect.

This commit is inspired by this post:
https://www.puredevsoftware.com/blog/2019/01/22/sub-pixel-gamma-correct-font-rendering/
and factors in the background color when computing the colorized
glyph.

This appears to reduce the dark fringes/edges that we were seeing
before, without noticeably changing the brightness of the result.

refs: #491
2021-02-20 18:00:23 -08:00
Wez Furlong
4e2b2eddba split shaders, adjust srgb opengl render settings
https://learnopengl.com/Advanced-Lighting/Gamma-Correction suggests
some good practices:

* Only enable SRGB output on the final draw call, so that all prior
  stages can operate on linear values and avoid converting to/from
  linear multiple times.
* The SRGBA textures automatically linearize when sampled, but:
  * The RGB data must be SRGB (non-linear)
  * The A channel is assumed to be linear!

This commit nudges us closer to that by:

* Converting the freetype coverage map from its linear value to
  non-linear when rasterizing.
* Splitting the shader files into one per stage (background, lines,
  glyphs) and only setting outputs_srgb for the glyph stage

refs: #491
2021-02-20 17:12:36 -08:00
Wez Furlong
dd70a8a53b introduce freetype_load_flags and freetype_load_target config
In the earlier times wezterm supported different font rasterizers,
and the configuration was a bit vague and generic to accomodate
differences in how the rasterizers worked.

Since then, we've standardized on freetype.

One of the things that's been bothering me for a while is that
we have some fiddly logic to transform from the config to the freetype
flags.

This commit does away with the transformation and simply exposes
the two sets of freetype options.

The main thing that I expect people to play with is
`freetype_load_target` which can have one of the following values:

```
pub enum FreeTypeLoadTarget {
    /// This corresponds to the default hinting algorithm, optimized
    for standard gray-level rendering.
    Normal,
    /// A lighter hinting algorithm for non-monochrome modes. Many
    generated glyphs are more fuzzy but better resemble its original
    shape. A bit like rendering on Mac OS X.  This target implies
    FT_LOAD_FORCE_AUTOHINT.
    Light,
    /// Strong hinting algorithm that should only be used for
    monochrome output. The result is probably unpleasant if the glyph
    is rendered in non-monochrome modes.
    Mono,
    /// A variant of Normal optimized for horizontally decimated LCD displays.
    HorizontalLcd,
    /// A variant of Normal optimized for vertically decimated LCD displays.
    VerticalLcd,
}
```

I expect most people will want to set this to one of `Normal`, `Light`
or `HorizontalLcd`.  `HorizontalLcd` is what `font_antialias=Subpixel`
used to select.

refs: #491
2021-02-20 14:00:38 -08:00
Wez Furlong
528a4846c7 docs: changelog and improve the foreground_text_hsb docs
refs: #491
2021-02-20 11:36:04 -08:00
Wez Furlong
39b5a21107 docs: document foreground_text_hsb
It even has screen shots!

refs: #491
2021-02-20 11:24:10 -08:00
Wez Furlong
951d15f2a1 ci: avoid building binaries just for doc changes 2021-02-20 10:57:37 -08:00
Wez Furlong
088d8e5455 docs: note about config being a "pure function"
closes: #477
2021-02-20 10:53:29 -08:00
Wez Furlong
58fde836c3 docs: document various missing things
refs: https://github.com/wez/wezterm/issues/63
refs: https://github.com/wez/wezterm/issues/461
2021-02-20 10:40:26 -08:00
Wez Furlong
fd29ed09c4 docs: fix link to ClearScrollback 2021-02-20 08:44:39 -08:00
Wez Furlong
6c1c5f8714 docs: move mouse binding to its own page 2021-02-20 08:38:46 -08:00
Wez Furlong
08b6043166 gui: introduce foreground_text_hsb transform
This allows explicitly manipulating the hue, saturation, brightness
of the text rendered in the terminal, allowing users to dial in
the accidental effect that was introduced by
d886de8300

For example, this will punch up the brightness:

```
  foreground_text_hsb = {
    hue = 1.0,
    saturation = 1.0,
    brightness = 1.5,
  },
```

refs: https://github.com/wez/wezterm/issues/491
2021-02-19 08:30:32 -08:00
Wez Furlong
651e536d87 term: plumb Bell through toast notification channel
Per my comment: https://github.com/wez/wezterm/issues/3#issuecomment-780750798

this routes the bell through to the GUI layer, where it currently
does nothing about it.
2021-02-18 22:34:05 -08:00
Wez Furlong
f0c163e212 Plumb OSC 777 to toast notifications
```
echo -e "\033]777;notify;This is the notification title;This is the notification text\a"
```

Now pops up a notification in a similar manner to OSC 9, except
that this form allows setting both the title and the body separately.

refs: https://github.com/wez/wezterm/issues/489
2021-02-18 22:13:20 -08:00
Benoit de Chezelles
84a45f28e5 Send SIGHUP when terminating the pty child
This commit first delivers SIGHUP, then follows up with a regular
kill after a grace period.  This should allow processes an opportunity
to clean up when eg: the terminal window is closed.

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

closes: #490
2021-02-18 10:00:47 -08:00
Benoit de Chezelles
322fb5ee83 fmt 👀 2021-02-18 09:50:50 -08:00
Benoit de Chezelles
dc9784e0db Add comment 2021-02-18 09:50:50 -08:00
Benoit de Chezelles
18e8d48171 unix: Correctly signal child process on exit 2021-02-18 09:50:50 -08:00
Wez Furlong
3f91e30719 toast: windows: setup own AppUserModelID for our notifications
This is so that our notifications show as coming from wezterm
rather than powershell.
2021-02-17 23:45:52 -08:00
Wez Furlong
e331ff3626 toast: re-structure os-dependent bits
This reduces redundancy and makes things a bit more uniform.

refs: #489
2021-02-17 22:06:12 -08:00
Wez Furlong
d886de8300 remove overzealous alpha manipulation
This isn't a complete fix, but it's best to get this out
of the way and then take another pass as the dark outline.

refs: #491
2021-02-17 21:46:03 -08:00
Wez Furlong
83da7216c3 toast: hook notifications up to OSC 9
refs: #489
2021-02-17 09:33:58 -08:00
Wez Furlong
e10b3cf6db disable notifications on freebsd
There's a compilation issue for zbus on freebsd:
https://gitlab.freedesktop.org/dbus/zbus/-/issues/141
2021-02-16 23:12:19 -08:00
Wez Furlong
a2f891ad1b remove libdbus/libsystem dependency
Replaces notify-rust with directly calling into the zbus crate.
This provides a pure rust interface to DBUS and provides more
flexible control over notification handling.

closes: #485
2021-02-16 22:27:37 -08:00
Wez Furlong
c13b592d55 docs: changelog for #470
closes: #470
2021-02-16 20:24:09 -08:00
Wez Furlong
bc40c913ae ci: update homebrew template for macOS .app layout change 2021-02-16 09:50:39 -08:00
Wez Furlong
145b7695c7 wezterm: more adventures in antialiasing
This commit:

* Fixes up the alpha blending draw parameters as discussed in
  https://github.com/glium/glium/issues/1844 and
  https://github.com/PistonDevelopers/conrod/issues/1347

* Introduces `colorize` and `colorize_hsv` functions to the shader.
  comments in the code explain those functions in detail.

As of this commit, `colorize_hsv` is what is used now.  To my
eye on this mac, it produces blended glyphs with less noticeable
dark antialiasing fringes.

refs: #470
2021-02-15 21:21:24 -08:00
Wez Furlong
ff821c3b63 macos: moves things around in the .app
This should make things easier to codesign in the future,
although I can't really verify that right now, and I have
no immediate plans to do so.
2021-02-15 18:08:09 -08:00
Wez Furlong
7c18b8efad macos: tweak Info.plist
This adds custom descriptions for when permission is required
to inspect the filesystem.

I've never seen these actually take effect.
2021-02-15 18:08:09 -08:00
Wez Furlong
1c85950f97 cargo update 2021-02-15 12:14:00 -08:00
Wez Furlong
4e41bbd4e9 deps: speculative fix for #485
libdbus requires libsystemd, so we do too!
2021-02-14 09:30:42 -08:00
Wez Furlong
41cb9d3f38 wayland: attempt to handle seat changes that impact the keyboard
A couple of times today while debugging things on wayland, I lost
keyboard input to wezterm.

I don't know if that is strictly a wezterm bug, or just a general
wayland bug (not long after, the whole mutter session hung, and
somehow wedged all processes with my uid).

So, this is a quick stab in that direction.
2021-02-13 21:07:22 -08:00
Wez Furlong
b4ded64e14 wayland: fix an issue with key repeat potentially hanging/spinning 2021-02-13 19:47:06 -08:00
Wez Furlong
0473e1de78 wezterm: more adventures with background alpha
Is it *right*? Hard to say, but it looks better than
the behavior I see with master at the moment.

This is a partial revert of #413, but respins it to
try to get a better alpha value for glyphs.

refs: #413
refs: #470
2021-02-13 13:16:37 -08:00
Wez Furlong
f697de82fc wayland: fix initial window decoration, toggle full screen
This fixes a longstanding issue under mutter where client side
decorations are in use.  The decorations were being drawn too
early in the initialization of the window which could leave them
off-screen and weird.  This was masked by a couple of mutter
related bugs with client side decorations.

With these changes I now get sane decorations under mutter,
and the toggle fullscreen action is now enabled as well!

closes: #224
2021-02-13 11:02:04 -08:00
Wez Furlong
894d056947 wayland: allow matching raw modifiers for raw:123 key bindings 2021-02-13 09:11:55 -08:00
Wez Furlong
7b86a84bc3 window: avoid invalidating on mouse move
We weren't didn't treat the "No existing hyperlink, No new hyperlink"
case as no change in hyperlink, and were invalidating the window on
every mouse except for those over text with a hyperlink.
2021-02-13 08:49:09 -08:00
Greg V
58e2a181f2 wayland: do not create OpenGL context before the configure event
The existing code seems to use "configure" for just resizes,
so introduce a "start" flag in pending events to handle the
initial configure.
2021-02-12 16:56:24 -08:00
Wez Furlong
578b59ad33 fix one 32-bit build issue
refs: #474
2021-02-12 08:35:00 -08:00
Wez Furlong
6410827581 wayland: remove window from mux if gui fails to create window
This avoids a weird "headless hang" if a window doesn't come up with
opengl support.
2021-02-12 08:21:00 -08:00
Wez Furlong
a14e3669f2 window: update smithay-client-toolkit
However, I'm not able to create wayland windows any more on my nvidia
system (either with or without this change).

I don't know if this is specific to my nvidia drivers or something else
:-/

refs: https://github.com/wez/wezterm/issues/476
2021-02-12 08:19:51 -08:00
Wez Furlong
475260d3e3 Update bundled JetBrainsMono font to 2.225
refs: #452
2021-02-11 23:56:07 -08:00
Wez Furlong
6fbc54b93d docs: break out allow_square_glyphs_to_overflow_width separately
move this to is own file in the docs

refs: #462
2021-02-11 23:35:09 -08:00
Wez Furlong
ece9276624 term: large pastes could hang the terminal
Pasting a lot of text could cause a deadlock between writing
to the input side of the pty and consuming the output side.

Making the writer/input side non-blocking resolves this.
2021-02-11 23:32:19 -08:00