1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-22 22:42:48 +03:00
Commit Graph

599 Commits

Author SHA1 Message Date
Chris Pick
35df422ec7 Remove typo in hyperlink URL
The trailing 'A' lead to a 404, remove it.
2023-07-03 13:06:20 -07:00
Wez Furlong
71819b4abc
more fallout from Nerd Font symbols breaking changes in 3.0 2023-05-28 20:08:21 -07:00
Wez Furlong
e4b96bd9bb
update Symbols Nerd Font Mono to v3.0.1 2023-05-21 09:34:10 -07:00
cairijun
2428282b42 fix encoding Tab with modifiers 2023-05-20 20:04:46 -07:00
Wez Furlong
6686adba04
fix panic with corrupt webp file
There were a couple of layers of issue here:

* In the ImageDataType::decode method, we didn't detect and do something
  reasonable when the decoded image had 0 frames, later leading to
  a panic in glyphcache when trying to index frame 0 of an empty vec.
* We shouldn't have been using ImageDataType::decode for window
  background images
* Make the fallback/placeholder black rather than fully transparent
  in the more modern decoder thread routine that we use for image
  decoding at the gui layer.

refs: #3614
2023-04-25 08:39:42 -07:00
Wez Furlong
040a079b82
termwiz: input: avoid panic for certain numpad keys
refs: #3543
2023-04-17 08:04:29 -07:00
Wez Furlong
2b9ee388e3
refactor: move encode_modifiers to Modifiers::encode_xterm 2023-04-15 19:27:57 -07:00
Wez Furlong
3c40846d95
keyboard: move led status to separate enum 2023-04-15 14:52:54 -07:00
Wez Furlong
36d9e13c81
refactor: dedup ctrl_mapping function 2023-04-13 14:25:47 -07:00
Wez Furlong
1f7ff31179
termwiz: ignore caps/num lock when encoding keys in xterm encoding
refs: https://github.com/wez/wezterm/issues/3517
2023-04-13 14:24:04 -07:00
Wez Furlong
7d66bc761d
termwiz::Modifiers is now wezterm_input_types::Modifiers 2023-04-13 14:18:13 -07:00
Wez Furlong
e241ea58be
kitty keeb: move encoding logic to wezterm-input-types
We need access to the underlying raw/physical key in order
to correctly encode in some modes, so we need the full KeyEvent
struct for that.

Move the encoder up so it sits alongside the win32 input mode
encoder.

This should give us better results for both shifted/unshifted
and the "base layout" (US english) representations of a number
of keys.

Note that this is still not 100% technically correct: the unshifted
keys require knowledge of the keyboard layout that we don't have
at this OS-independent layer.

Right now we're assuming a US layout to unshift punctuation, which
is not right if you're not using that layout.  To resolve that,
more work is needed on each OS to be able to extract that information
and then to store it in the KeyEvent.

refs: https://github.com/wez/wezterm/issues/3479
refs: https://github.com/wez/wezterm/issues/2546
2023-04-10 08:54:03 -07:00
Wez Furlong
54a65a5401
kitty keeb: adjust legacy encoding logic
Just consider all ascii alphanumeric and punctuation as legacy
so that we don't decide to encode those as escapes when not required.

refs: #3315
2023-04-09 21:53:46 -07:00
Wez Furlong
a9165ae4c4
kitty keeb: fixup tests
refs: #3315
2023-04-09 13:22:25 -07:00
Wez Furlong
b704ec6d70
kitty keyboard: improve mode 1 support
We don't need to encode as many keys in mode 1.

refs: #3315
2023-04-09 13:05:23 -07:00
Wez Furlong
f4995511e2
keyboard: improve support for numpad buttons
We were missing encoding of these for the base xterm encoding
(I haven't daily driven a keyboard with a numpad in over 10 years!).

Improve mapping for the kitty protocol.

refs: https://github.com/wez/wezterm/issues/3478
2023-04-09 12:28:30 -07:00
Wez Furlong
2dcf7ad98d
keyboard: plumb more modifier+state information through
This commit teaches the termwiz layer about positional modifiers,
and expands our modifier concept to also pass through led states
such as caps lock and num lock.

Those aren't actually keyboard modifiers, but the state is useful
to recognize.

Adjust the shift key normalization so that we don't uppercase
alpha characters when both SHIFT and CAPS_LOCK are held.
This processing will remove both SHIFT and CAPS_LOCK in that
situation.

Add a method to KeyEvent that will undo the OS keyboard layer
normalization of positional to generic modifier key presses.
eg: the OS may map LeftControl -> Control, but we actually
prefer to have LeftControl so if we can unambiguously reverse
that mapping, we do so.

refs: #3476
refs: #3475
2023-04-09 10:34:53 -07:00
Wez Furlong
397593be5c
kitty keeb: fixup shifted character encoding
refs: https://github.com/wez/wezterm/issues/3474
2023-04-08 20:01:10 -07:00
Wez Furlong
0540301121
kitty keeb: add test case for #2546
This passes, so I'm assuming that one of the other kitty
commits from today has resolved this.

refs: https://github.com/wez/wezterm/issues/2546
2023-04-08 19:28:22 -07:00
Wez Furlong
8bb39bd6f3
fixup kitty keyup events for alphabetical keys
refs: https://github.com/wez/wezterm/issues/3220
2023-04-08 19:19:27 -07:00
Wez Furlong
d239e65e64
fixup kitty keyboard encoding for F1-F4
refs: https://github.com/wez/wezterm/issues/3473
2023-04-08 18:19:07 -07:00
Wez Furlong
7b40f01054
switch to fancy-regex crate
Enables back references and look around assertions for quick select
and hyper link rules

refs: https://github.com/wez/wezterm/issues/3247
2023-04-07 17:39:00 -07:00
Jalil David Salamé Messina
6dd8a98ff3 fix: Derive Eq on Selection 2023-03-27 07:38:55 -07:00
Jalil David Salamé Messina
2315834109 fix: Use serde with bitflags 2023-03-27 07:38:55 -07:00
Jalil David Salamé Messina
c2f63c296b fix: Formatting 2023-03-27 07:38:55 -07:00
Jalil David Salamé Messina
fc5e8b4f3d fix: Update signal-hook to 0.3 and fix compilation errors
- Some functions are now under the `low_level` module, use that
2023-03-27 07:38:55 -07:00
Jalil David Salamé Messina
344f133608 chore: Update criterion to 0.4 2023-03-27 07:38:55 -07:00
Jalil David Salamé Messina
05df6ec054 chore: Update nix to 0.26 2023-03-27 07:38:55 -07:00
Jalil David Salamé Messina
7f89f46ae5 fix: Update bitflags to 2.0 and fix compilation errors
- v2.0 no longer derives a bunch of traits (Debug, Clone, Copy, PartialEq, Eq)
  by default, so I manually derived them.
- It also changed the snapshot results so I updated them:

  An empty bitflags struct is no longer displayed as `None` but as
  `BitFlags(0x0)`.

- `bits` is no longer a field but a method so I added the missing
  parenthesis.
2023-03-27 07:38:55 -07:00
Jalil David Salamé Messina
7721126fdd chore: Update phf to 0.11 2023-03-27 07:38:55 -07:00
Wez Furlong
5b51179265
deps: update sha2
closes: https://github.com/wez/wezterm/pull/3379
2023-03-26 19:50:53 -07:00
Wez Furlong
2e488d57c7
update terminfo to 0.8 2023-03-24 10:12:49 -07:00
Wez Furlong
bc7acc18e0
fixup images with the multiplexer
* Translate from File to EncodedFile as needed
* Adopt blob leases in the mux server
* Fix an issue where the first image sent by the mux server would
  be replaced on the client by its background image, if configured.
  Removed the ImageData::id field to resolve this: you should use
  the hash field instead to identify and disambiguate images.
  Bumped the termwiz API version because this is conceptually
  a breaking change to the API

refs: https://github.com/wez/wezterm/issues/3343
2023-03-23 21:43:28 -07:00
Wez Furlong
0f8146b212
docs: shift from return {} style to config.something style
Nudge new users towards using this style:

```lua
local config = {}
config.color_scheme = 'Batman'
return config
```

and surface how to write lua modules closer to the main section
on config files. In that lua modules section, nudge towards using
a convention similar to that of the plugin spec described in
this commit: e4ae8a844d
2023-03-19 18:26:21 -07:00
Wez Furlong
c1e9bcba5f
fix non-serde termwiz build 2023-03-18 22:21:42 -07:00
Wez Furlong
7cd0cc21bf
ImageDataType::File -> EncodedLease
Adopt the new blob lease layer to storing and referencing
image files.

This reduces the number of open files needed when
images are being displayed in the terminal.

refs: https://github.com/wez/wezterm/issues/3263
2023-03-18 20:32:49 -07:00
Wez Furlong
2d255c2d75
fix kitty image protocol handling
Input data:

\e_Ga=T,f=32,s=10,v=22,c=1,r=1,m=1\e\\e_Gm=1;/xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T//P=\e\\e_Gm=1;/xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T////E////xP///8T//P=\e\\e_Gm=0\e\

There were two issues in handling this:

* We expected there to be `;payload` in the first transmission packet,
  but there wasn't one, so we ignored it as ill-formed.
* The standard base64 decoder in the rust ecosystem is super strict
  and rejects the "sloppy" python base64 encoder output that isn't
  strictly conformant with the RFC.  We need to jump through some
  hoops to get it to relax and accept the input.

refs: https://github.com/wez/wezterm/issues/2716
2023-03-17 15:39:01 -07:00
Wez Furlong
e090eb9eae
Image decoding is now done in a bg thread
Continuing from the previous commit, this shifts:

* In-memory data -> temporary file
* Image decoding -> background thread

The background thread asynchronously decodes frames and
sends them to the render thread via a bounded channel.

While decoding frames, it writes them, uncompressed, to
a scratch file so that when the animation loops, it is
a very cheap operation to rewind and pull that data
from the file, without having to burn CPU to re-decode
the data from the start.

Memory usage is bounded to 4 uncompressed frames while
decoding, then 3 uncompressed frames (triple buffered)
while looping over the rest.

However, disk usage is N uncompressed frames.

refs: https://github.com/wez/wezterm/issues/3263
2023-03-17 11:41:20 -07:00
Wez Furlong
aa929a1a9b
move animation decoding from term layer to gui layer
This makes decoding animation frames a lazy operation, but it
comes at the cost of needing to re-decode the image from scratch
when it loops, because the image crate doesn't provide a way
to rewind its frame iterator.

That initial decode can have a significant time cost; a small
webp file consistently takes 150ms to decode, which is too
much to do inline in the render thread.

Next steps will be to move that cost off the render thread.
2023-03-17 11:41:20 -07:00
Wez Furlong
6a9dfc409d
improve default hyperlink_rules. add default_hyperlink_rules()
refs: https://github.com/wez/wezterm/issues/928
2023-03-16 20:44:15 -07:00
Wez Furlong
2bfb29f1be
improve handling of animated webp images
Use mainline image crate to avoid an otherwise unavoidable panic
in the upstream: https://github.com/image-rs/image/issues/1775

Explicitly operate on the frames from the animation.

refs: https://github.com/wez/wezterm/issues/3250
2023-03-15 11:34:47 -07:00
Wez Furlong
3509e210ce
termwiz: bump version ready for publish 2023-02-12 06:57:31 -07:00
Aram Drevekenin
f2e342a25f fix(input): support alt-left-bracket 2023-02-12 05:46:17 -08:00
Wez Furlong
44e162a986
fonts: update Symbols Nerd Font Mono
This is "NerdFontsSymbolsOnly/Symbols-1000-em Nerd Font Complete Mono.ttf" from
https://github.com/ryanoasis/nerd-fonts/releases/tag/v2.3.3
2023-02-06 06:29:32 -07:00
Thomas Linford
aadc8224e9 finish test 2023-02-05 06:32:03 -08:00
Thomas Linford
ad8c393fbb fix: correctly set WHEEL_POSITIVE 2023-02-05 06:32:03 -08:00
Thomas Linford
96ed17aaca wip: horizontal scroll support 2023-02-05 06:32:03 -08:00
Wez Furlong
36519f0d90
fix crash bug uncovered by rust 1.67
Rust 1.67, released today, is a bit more particular about the layout
of the memory used in TeenyString and segfaults in the test suite.

On closer inspection, our Drop impl was casting to Vec<u8> instead of
TeenyStringHeap and the fault was freeing bogus memory within that
region.

Fixing the cast to the correct type resolves the issue.
2023-01-26 17:00:21 -07:00
Wez Furlong
d34297cd2c
update base64, work around another batch of breaking API changes
closes: https://github.com/wez/wezterm/pull/2931
2023-01-08 18:49:45 -07:00
Wez Furlong
fe60155d3d
withdraw DEC private SGR handling for super/subscript
refs: https://github.com/mintty/mintty/issues/1189
refs: https://github.com/mintty/mintty/issues/1171
2022-12-19 11:37:53 -07:00