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

5359 Commits

Author SHA1 Message Date
Wez Furlong
53fc926b1c gui: fix wonky logic for simple_dpi_change
The condition should be: dpi-changed && (close-enough-stuff)
but was (dpi-changed && (some-close-enough-stuff)) ||
(other-close-enough-stuff).

The net result was toggling non-native full screen on macos could
falsely try to do scale change handling even though the dpi was
unchanged, because the window resized by only a couple of pixels.
2022-03-27 16:28:07 -07:00
Wez Furlong
b9c194c0d3 sixel: remove leftover debug
refs: #217
2022-03-27 16:27:14 -07:00
Wez Furlong
77e5cdd00d sixel: improve sixel parsing performance.
Test scenario is:

```
wezterm -n --config enable_kitty_graphics=false
./notcurses-demo -p ../data iv
```

In `20220326-231415-4cd89333`

```
             runtime│ frames│output(B)│    FPS│%r│%a│%w│TheoFPS║
══╤════════╤════════╪═══════╪═════════╪═══════╪══╪══╪══╪═══════╣
 1│   intro│  12.38s│    238│  10.50Mi│   19.2│ 1│ 0│82│  22.82║
 2│    view│  37.87s│    982│  89.35Mi│   25.9│ 0│ 0│46│  54.31║
══╧════════╧════════╪═══════╪═════════╪═══════╧══╧══╧══╧═══════╝
              50.25s│   1220│  99.86Mi│
```

With this commit:

```
             runtime│ frames│output(B)│    FPS│%r│%a│%w│TheoFPS║
══╤════════╤════════╪═══════╪═════════╪═══════╪══╪══╪══╪═══════╣
 1│   intro│   3.39s│    458│  23.13Mi│  135.2│ 8│ 1│17│ 490.79║
 2│    view│  18.59s│    978│  89.35Mi│   52.6│ 1│ 0│ 5│ 645.10║
══╧════════╧════════╪═══════╪═════════╪═══════╧══╧══╧══╧═══════╝
              21.98s│   1436│ 112.48Mi│
```

as a point of comparison, here's the kitty protocol numbers on
the same build:

```
             runtime│ frames│output(B)│    FPS│%r│%a│%w│TheoFPS║
══╤════════╤════════╪═══════╪═════════╪═══════╪══╪══╪══╪═══════╣
 1│   intro│   3.68s│    485│  39.49Mi│  131.7│ 5│ 1│23│ 421.85║
 2│    view│  20.66s│    979│ 423.90Mi│   47.4│ 1│ 0│18│ 225.83║
══╧════════╧════════╪═══════╪═════════╪═══════╧══╧══╧══╧═══════╝
              24.34s│   1464│ 463.39Mi│
```

so we're now in the same ballpark.

cc: @autumnmeowmeow in case you have some other sixel benchmarks
to help verify this :)

refs: https://github.com/wez/wezterm/issues/217
2022-03-27 15:30:43 -07:00
Wez Furlong
15cd990e33 refactor: move sixel parser/builder to own file 2022-03-27 13:38:33 -07:00
Wez Furlong
5b0edfddea hyperlink rules: avoid panic when a capture is missing
```
./target/debug/wezterm -n --config 'hyperlink_rules={{regex="pr-(\\d+)(-\\d)?",format="https://github.com/NixOS/nixpkgs/pull/$1"}}'
```

then output `pr-1`.

refs: #1780
2022-03-27 11:12:16 -07:00
Wez Furlong
3c701d9dc8 mux: propagate focus changes to remote mux
Pretty much the same test plan as b4c4c85683

but start wezterm:

./target/debug/wezterm -n --config 'ssh_domains={{name="s",remote_address="localhost"}}' connect s

This reliably propagates focus=true events, but if the client switches
focus away from a mux pane to a local pane, then the focus=false event
may not be propagated to the remote mux.

refs: #1608
2022-03-27 09:30:18 -07:00
Wez Furlong
26acdae1d9 docs: changelog for #1757 #1710 2022-03-27 07:57:52 -07:00
Wez Furlong
045698e6ca x11: query focus prior to painting if we don't know focus state
We don't assume that we start up focused, and some WM don't tell
us our focus state, so prior to painting, if we don't know the
focus state, explicitly query it and synthesize a focus change event.

refs: https://github.com/wez/wezterm/issues/1757
2022-03-27 07:10:47 -07:00
Wez Furlong
4cd893335b fix build for intel mac 2022-03-26 23:14:15 -07:00
Wez Furlong
4e343eb1e5 macos: try to avoid the notch
Flesh out the get_os_parameters impl for macOS.  When running on a
system that provides `NSScreen::safeAreaInsets`, use that to determine
the border required to avoid the "notch" on certain models of mac.

In the GUI layer: when the os parameters include a border, adjust
the render position to account for it.

This is a bit of a speculative change, as I don't have a mac with
a notch.

refs: https://github.com/wez/wezterm/issues/1737
2022-03-26 22:47:42 -07:00
Wez Furlong
a61d3a1b99 macos: clear scroll remainder when changing scroll direction 2022-03-26 20:46:28 -07:00
Wez Furlong
97c71eb91f docs: update IME docs
refs: https://github.com/withfig/fig/issues/58
refs: https://github.com/wez/wezterm/issues/1772
2022-03-26 18:19:04 -07:00
Wez Furlong
98079b6b46 docs: changelog for #1771 #1773 #1725 #949 2022-03-26 17:48:56 -07:00
David Rios
491fe14ca9 Fix touchpad on windows 2022-03-26 17:45:40 -07:00
David Rios
fca3559a0f
Implement native window dragging on Windows (#1771)
Implement native window dragging on Windows
2022-03-26 17:28:43 -07:00
Wez Furlong
3e91f23452 fix build/tests 2022-03-26 17:00:03 -07:00
Wez Furlong
4e6b348921 fonts: allow fallback-level scaling factor
This commit allows specifying a scaling factor as part of the font
attribute definition.  This scaling factor is fed through to the
rasterizer and the shaper to adjust the actual font size that is
loaded.

The intent is to provide manual control for situations where the
fallback font has a different scale to the primary font and renders
either too small or too large.

The concrete example is
https://github.com/wez/wezterm/issues/1761#issuecomment-1079708207 where
the CJK fallback looks too small.

The scaling factor doesn't influence font metrics so it may also be
desirable to configure line height.

```lua
local wezterm = require 'wezterm'

return {
  line_height = 1.2,
  font = wezterm.font_with_fallback({
    "JetBrains Mono",
    {family="Microsoft YaHei", scale=1.5},
  }),
}
```
2022-03-26 16:37:50 -07:00
Wez Furlong
1c605f7bf1 Add Constant easing function
refs: https://github.com/wez/wezterm/issues/1738
2022-03-26 11:25:06 -07:00
Wez Furlong
8eb497fa19 deps: harfbuzz -> 4.1.0 2022-03-26 10:51:35 -07:00
Wez Furlong
6d7f3e2e0b docs for https://github.com/wez/wezterm/issues/1745 2022-03-26 10:01:58 -07:00
Wez Furlong
d448c0a540 docs: fix inactive_tab_edge example
https://github.com/wez/wezterm/issues/1547#issuecomment-1076521858
2022-03-26 09:58:13 -07:00
Wez Furlong
4035860f45 update retro tab bar hover state in more cases
refs: https://github.com/wez/wezterm/issues/1764
2022-03-26 09:45:12 -07:00
Wez Furlong
7f3a29dccb docs: changelog for #1761 2022-03-26 08:20:44 -07:00
Wez Furlong
895a96f842 docs: changelog for #1502 and #1675 2022-03-26 07:57:14 -07:00
Wez Furlong
91a0903246 windows: simplify logfont assignment/fetch 2022-03-26 07:52:25 -07:00
David Rios
109330fefa Get window state on resize, fixes #1502 2022-03-26 07:27:54 -07:00
David Rios
5c5f2dbca5 Cache title_font 2022-03-26 07:27:54 -07:00
David Rios
eaaf98ad2f Uncomment title font 2022-03-26 07:27:54 -07:00
David Rios
c55d44aa72 Use anyhow ensure
Co-authored-by: Wez Furlong <wez@wezfurlong.org>
2022-03-26 07:27:54 -07:00
David Rios
da74100d5e Use equality to check focus
Co-authored-by: Wez Furlong <wez@wezfurlong.org>
2022-03-26 07:27:54 -07:00
David Rios
b3f1ef7577 Remove unused function 2022-03-26 07:27:54 -07:00
David Rios
a95b081620 Improve the responsiveness of the drawn border 2022-03-26 07:27:54 -07:00
David Rios
b036bb3b05 Improve RESIZE window_decoration on Windows 2022-03-26 07:27:54 -07:00
Wez Furlong
32bf0d281e fonts: improve font name decoding
freetype can't handle a wide range of encodings for
font names and can return strings like `?????` when
the family name is only present in the font as a non-unicode encoding,
such as Chinese.

This commit improves our handling of the font name table
and prefers to use results from processing that over the
results returned for eg: font family directly from the
freetype API.

refs: https://github.com/wez/wezterm/issues/1761
2022-03-25 23:27:27 -07:00
Wez Furlong
72cbf4caeb record: add more metadata, change filename suffix to .txt
The metadata is useful from a troubleshooting/diagnostic perspective.

`.cast` isn't on github's list of allowed file name suffixes, so make
it a simple text file for convenience.
2022-03-25 09:46:24 -07:00
Wez Furlong
4f2539f8e6 record: add support for running on Windows 2022-03-25 08:40:58 -07:00
Wez Furlong
e535b2d498 Add wezterm record and wezterm replay subcommands
These are intended to replace the `wt-record` and `wt-replay` scripts
that are primarily for me to diagnose wezterm issues.

The thinking is that this gives a cross platform implementation of
this functionality and squashes out some of the pain of dealing with
different versions and file formats.

The new subcommands use the asciicast v2 file format, meaning that
wezterm can record for asciicast/asciinema and vice-versa.

This commit only handles unix; windows support will follow in
a separate commit.
2022-03-25 08:40:58 -07:00
Wez Furlong
638278f7e7 Try harder to get LANG set on macos
Treat empty LANG the same as unset LANG.
If setlocale fails, fall back to en_US.UTF-8 and log a message.

refs: https://github.com/wez/wezterm/issues/1761
2022-03-24 18:26:33 -07:00
Wez Furlong
e500c9c5c0 Fix quoting of style field in ls-fonts
refs: https://github.com/wez/wezterm/issues/1762
2022-03-24 18:06:13 -07:00
Wez Furlong
185f52efaf remove some dead code 2022-03-23 20:43:50 -07:00
Wez Furlong
623f617951 x11: window icon had red/blue channels swapped
closes: #1754
closes: #1755
2022-03-23 07:01:26 -07:00
Wez Furlong
5c8ff787c6 x11: query geometry if we're painting and never had CONFIGURE_NOTIFY
If the WM has never confirmed our size and we're about to paint,
explicitly query it and generate a resize event so that we stand
a better chance of showing the right stuff.

refs: https://github.com/wez/wezterm/issues/1710
2022-03-22 09:50:52 -07:00
Wez Furlong
57c66053d2 x11: more logging around configure notify events
refs: #1710
2022-03-22 09:30:50 -07:00
Wez Furlong
9936b8a5ab add xcursor_theme and xcursor_size config options
refs: #1742
2022-03-22 08:23:17 -07:00
Wez Furlong
409ff74b84 gui: speculative improvement for resize/scaling issue
I think this may help with #1745 and #1566 but I'm not on a mac
at the moment(!)
2022-03-22 06:41:22 -07:00
Wez Furlong
5b09ff1dd0 fix incorrect csi-u encoding with non-ascii characters
refs: https://github.com/wez/wezterm/issues/1746
2022-03-21 20:38:42 -07:00
Wez Furlong
aba3da6a02 deps: cargo update 2022-03-21 07:47:57 -07:00
Wez Furlong
ee5d5714ca docs: update for 20220319-142410-0fcdea07 2022-03-19 16:37:27 -07:00
Wez Furlong
0fcdea0789 sixel: allow slightly poorly formed sixel data
The issue appears to be due to a rogue trailing semicolon in the input
data.  Support for this appears to be mixed: an online converter didn't
produce valid output, but image magick's convert utility accepted it.

This commit allows an optional trailing semicolon at the end of the
color definition regex and enables wezterm to render the image.

refs: https://github.com/wez/wezterm/issues/1711
2022-03-19 14:24:10 -07:00
Wez Furlong
737eb6e912 docs: animation_fps 2022-03-19 11:42:35 -07:00