1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-26 23:04:49 +03:00
Commit Graph

1361 Commits

Author SHA1 Message Date
Wez Furlong
6938701cd3
wgpu: use adapter limits to avoid panic on window resize 2024-01-20 12:33:22 -07:00
Wez Furlong
7ae615b01d
simplify png decoding
refs: https://github.com/image-rs/image/issues/1989
2024-01-20 12:33:16 -07:00
Wez Furlong
9acc2ae6c5
deps: update to wgpu 0.19 2024-01-20 12:09:52 -07:00
Wez Furlong
c23e957ee2
glyphcache: avoid deprecated image method
There's one other that is slated for deprecation but that
doesn't have advice on how to replace it yet.

refs: https://github.com/image-rs/image/issues/1989
2024-01-20 10:17:23 -07:00
Wez Furlong
c607c6a59c
allow rgba for all window_frame colors
refs: https://github.com/wez/wezterm/issues/3580
2024-01-20 10:06:02 -07:00
Wez Furlong
8023948647
remove unused pub use 2024-01-08 05:51:39 -07:00
dependabot[bot]
68d9cfc6ad build(deps): bump the all group with 6 updates
Bumps the all group with 6 updates:

| Package | From | To |
| --- | --- | --- |
| [k9](https://github.com/aaronabramov/k9) | `0.11.6` | `0.12.0` |
| [anyhow](https://github.com/dtolnay/anyhow) | `1.0.78` | `1.0.79` |
| [serde](https://github.com/serde-rs/serde) | `1.0.193` | `1.0.194` |
| [serde_json](https://github.com/serde-rs/json) | `1.0.109` | `1.0.110` |
| [clap_complete](https://github.com/clap-rs/clap) | `4.4.5` | `4.4.6` |
| [thiserror](https://github.com/dtolnay/thiserror) | `1.0.53` | `1.0.56` |


Updates `k9` from 0.11.6 to 0.12.0
- [Commits](https://github.com/aaronabramov/k9/commits)

Updates `anyhow` from 1.0.78 to 1.0.79
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.78...1.0.79)

Updates `serde` from 1.0.193 to 1.0.194
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.193...v1.0.194)

Updates `serde_json` from 1.0.109 to 1.0.110
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.109...v1.0.110)

Updates `clap_complete` from 4.4.5 to 4.4.6
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.4.5...clap_complete-v4.4.6)

Updates `thiserror` from 1.0.53 to 1.0.56
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.53...1.0.56)

---
updated-dependencies:
- dependency-name: k9
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all
- dependency-name: anyhow
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all
- dependency-name: clap_complete
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all
- dependency-name: thiserror
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-03 10:29:24 -07:00
Andrew Stone
28ac1c845b
Adds config option for command palette rows (#4595)
Co-authored-by: Wez Furlong <wez@wezfurlong.org>
2023-12-01 07:56:41 -07:00
Wez Furlong
7590968257
fix a couple of new redundant clone warnings in rust 1.73 2023-10-30 07:45:59 -07:00
Wez Furlong
3e01871876
deps: wgpu -> 0.18 2023-10-30 07:41:12 -07:00
Wez Furlong
453ff8dab5
deps: http_req -> 0.10 2023-10-29 18:28:13 -07:00
Wez Furlong
845fa5d4ae
add notification_handling option to control suppression
refs: https://github.com/wez/wezterm/issues/3727
2023-09-28 18:05:18 -07:00
Wez Furlong
c75f20f21c
deps: ordered-float -> 4.1.0
closes: https://github.com/wez/wezterm/pull/4338
2023-09-28 14:39:22 -07:00
Danielkonge
525080be89
Additions to the InputSelector (resolving #4226) (#4227)
* First step towards implementing #4226.
* Added InputSelector config options.
* Format + fix to prepare for PR to resolve #4226.
* Accept suggestion about pop().
* Fix typo.
* Tried fixing stuff from the feedback.
* Fixed typo.
* Fixed small mistake in docs.
* Small fix for label computation.
* Allow uppercase alphabet + add fuzzy_description.
* Minor cleanup.
* Use more standard alphabet (without j/k).
* Fixed docs after previous commit.
* Added key assignments to docs.
* Apply suggestions from code review (2 remaining)
* Updated arcording to feedback (added tests).
* Update docs (1 thing left to do)
* Added version details to the key table.

---------

Co-authored-by: Wez Furlong <wez@wezfurlong.org>
2023-09-22 06:42:43 -07:00
Wez Furlong
2c95b98447
text cursor glyph renders at native cell size
Previously we'd use the scaled-by-line-height-and-cell-width dimensions
for the text cursor, leading to oddly dimensioned block cursors when
`line_height` or `cell_width` were configured.

This commit captures the native cell dimensions into the RenderMetrics
which makes it feasible for the glyph and sprite rendering logic to
reason about it.

The cursor rendering now renders at the native size and position by
using a transform to scale and translate into the correct spot.

We could potentially use the same technique for eg: braille or
other non-drawing characters
(https://github.com/wez/wezterm/issues/1957) although that is more
complex than just this commit.

refs: https://github.com/wez/wezterm/issues/2882
2023-08-26 14:11:13 -07:00
Wez Furlong
360ad2a3a9
fix strikethrough position for line_height != 1.0 2023-08-26 13:01:41 -07:00
Wez Furlong
b904ed7677
breaking(ish): pane.get_current_working_dir now returns Url
Previously we'd return the Url string.  Now we provide a Url
object that provides access to the various elements of the Url.

This will cause slightly breakage for folks that were treating
it as a string in their status event handlers, for example.

The docs have been updated to show how to run with both this
new Url object and also continue to run on older versions of
wezterm.

They now also show how to manually percent decode the url
for older versions of wezterm.

refs: https://github.com/wez/wezterm/discussions/4157
refs: https://github.com/wez/wezterm/issues/4000
2023-08-25 06:59:09 -07:00
Wez Furlong
53988c7fe6
PaneSelect: add SwapWithActiveKeepFocus
refs: #3014
2023-08-24 22:32:19 -07:00
Wez Furlong
a9c7d28b09
PaneSelect: MoveToNewTab, MoveToNewWindow and show_pane_ids
refs: #4147
2023-08-24 19:56:46 -07:00
Wez Furlong
7c88c179e1
charselect: add emoji variations and new short codes section
Move the shortcode aliases out from the various emoji category
pages and into a new shortcode page.

Add variations, such as skin tones, to the different emoji
category pages.
2023-08-22 22:53:14 -07:00
Wez Furlong
c7cc3e4d81
charselect: parallelize fuzzy matching
This gets the matching time down below 110+ms to around 70ms
in release mode, which may not sound like a huge amount, but 100ms
is on the cusp of perceivable latency, so getting below that is
desirable.
2023-08-22 20:22:09 -07:00
Wez Furlong
4d33b3b535
shapecache fixup test for updated noto font 2023-08-22 09:53:59 -07:00
Wez Furlong
8f4f9653c5
font: adjust metrics for pre-scaled bitmap glyphs
When using the harfbuzz rasterizer with a bitmap glyph, the result
is a rasterized glyph that is pre-scaled to the cell dimensions.

We need to tell glyphcache that that has happened, otherwise it
will apply the same scale factor again.
2023-08-20 17:32:42 -07:00
Wez Furlong
7264030a28
fonts: adopt fixed crate for freetype fixed-point math
This found at least one bug and should prevent future bugs.
2023-08-20 15:19:30 -07:00
Wez Furlong
0499ab0430
mlua 0.9 is now stable; update 2023-08-17 09:26:47 -07:00
Wez Furlong
2a7167a0ef
fix some warnings 2023-08-06 09:18:40 -07:00
Wez Furlong
18d93fce5a
gui: remove config.dpi override logic
The overrides are now applied at the window layer, which is (mostly!)
aware of per-screen overrides.

refs: #4096
2023-08-06 08:45:14 -07:00
Wez Furlong
d1d4db20be
cargo update
Transitive deps now require rust 1.71, so update for that, as well
as some other minor changes required by transitive deps.
2023-07-30 20:09:15 -07:00
Wez Furlong
a07ab883af
persist charselect, repl history and others in data dir
We were using the runtime dir with a fallback to a directory
that was equivalent to the data dir on !xdg systems.  That
meant that the state in the runtime dir was often scrubbed
around a reboot.

refs: https://github.com/wez/wezterm/discussions/4019
refs: https://github.com/wez/wezterm/issues/4047
2023-07-22 10:31:03 -07:00
Wez Furlong
3e3df823e4
deps: update wgpu -> 0.17
Pick up my fix from https://github.com/gfx-rs/wgpu/pull/3924

closes: https://github.com/wez/wezterm/issues/3612
2023-07-22 08:00:59 -07:00
Wez Furlong
b7771feef6
imgcat: work better with tmux and conpty
Neither of these understand image protocols, and both are
an additional processing layer between the application and
wezterm.

This commit detects and wraps OSC sequences in tmux's passthru
sequence so that the data is passed on to wezterm rather than
elided from the data stream.

For image protocols in both tmux and conpty, work a little
smarter and explicitly move the cursor position to the same
location that wezterm would move it to.  That prevents the
display from being as mangled by tmux/conpty due to a diverging
understanding of the cursor position.

The logic isn't perfect, and can result in the x-coordinate
being incorrect, and this won't work with the new --position
argument either in its current state, without adding a lot
of complexity to deal with scrolling and relative and absolute
positioning handling.

To facilitate that, a new termwiz Terminal trait method has
been added to probe the terminal name, version, cell and pixel
dimensions. It's not pretty.

refs: https://github.com/wez/wezterm/issues/3624
refs: https://github.com/wez/wezterm/issues/3716
2023-07-15 22:13:19 -07:00
Wez Furlong
31eb4fe271
fix window:perform_action
Accidentally broken by 750f49f0ae

refs: https://github.com/wez/wezterm/issues/3981
2023-07-13 07:37:05 -07:00
Wez Furlong
750f49f0ae
deps: upgrade mlua to 0.9.0-rc.1
refs: https://github.com/khvzak/mlua/issues/291
refs: #3849
2023-07-12 14:14:55 -07:00
Wez Furlong
c7ff432581
mux server: register additional domains
Relocate the helper function to mux-server-impl and have both the GUI
and the mux server call it at the appropriate times.

Introduce default_mux_server_domain which is used instead of
default_domain in the mux server.  This is to avoid recursive
cycles when starting up the mux; we don't want the default
domain to be a unix client that connects to our selves because
we'll try to connect to ourselves, then in act of handling that
spawn in the default domain and try to connect to ourselves and
repeat.

refs: https://github.com/wez/wezterm/issues/3907
2023-07-11 09:34:34 -07:00
Magnus Groß
087e11ebbb Drop duplicate entries from CharSelect menu
Previously the same emoji was able to appear multiple times in the
CharSelect modal for emoji input, because one emoji might have multiple
aliases. In fact, often the aliases have similar names, making it
especially likely that a fuzzy match matches multiple aliases at the
same time.

The same Unicode char may even match multiple times both as
Character::Unicode as well as a Character::Emoji.

To make the deduplication easy, store the results in a hash map instead
of a vector. We use the glyph as the key of the map to get free
deduplication.

Only update the mapped value, if a duplicate entry would improve the
score.

Performance-wise this is pretty much identical to the previous state.
We do see minor performance regression for very large n - granted, this
is expected as we do more work - but the use of the HashMap covers up
for a large part of it.

If the user types more than 3 characters, the performance is absolutely
identical. For less than 3 characters, the performance was unacceptable
anyway (700 ms before this patch, 800 ms after this patch on my system).

Here is a side-by-side comparison for a user iteratively typing the
query "no-evil":

#  Before         After
1  718.361276ms   837.612275ms
2  719.532450ms   816.348394ms
3  349.625101ms   369.726458ms
4  356.349671ms   354.367768ms
5  363.862194ms   361.985546ms
6  372.339582ms   370.022932ms
7  381.123785ms   378.349672ms

In fact, for small n, the hash map seems to perform even slightly better
than the vector.
For large n we need to optimize the performance anyway, as both 700ms
and 800ms are unacceptable.
Thus, this is worth it for the benefit of Unicode symbol deduplication.
2023-07-10 17:16:23 -07:00
Rémi Labeyrie
da2c035ad2 feat: handle horizontal mousewheel events 2023-07-10 12:55:13 -07:00
Wez Furlong
f901dfbf68
deps: tiny-skia -> 0.11 2023-07-09 18:28:48 -07:00
Wez Furlong
96f5c2b562
images: wait for first frame of decoded images
Avoid flickering with the interim black frame but waiting up to 125ms
for the first frame to be decoded.

refs: #3882
2023-07-09 16:29:59 -07:00
Wez Furlong
2334e679a9
launcher: add ctrl-j/k assignments
refs: #3909
2023-06-29 07:59:41 -07:00
Wez Furlong
c1f495099e
deps: fastrand -> 2.0 2023-06-19 10:44:21 -07:00
Wez Furlong
c1147720bc
remove old paste chunking logic
I believe that this was obsoleted long ago by the ThreadedWriter
logic that is present in the terminal implementation so we no
longer need to limit the write chunk size.

refs: #3683
2023-05-29 15:10:57 -07:00
Wez Furlong
853fb00302
even more fallout from Nerd Font symbols breaking changes in 3.0 2023-05-29 14:15:00 -07:00
Wez Furlong
7e2b7ca84d
deps: update tiny-skia
closes: https://github.com/wez/wezterm/pull/3794
2023-05-28 20:18:00 -07:00
Ye Sijun
95ab807aab add color config for char select
Signed-off-by: Ye Sijun <junnplus@gmail.com>
2023-05-28 09:01:22 -07:00
Wez Furlong
9b31092e1d
fix fallback scaling for background images
We weren't redrawing the background image with the scale factor
that we'd computed when noticing that we had run out of texture space.

refs: #3773
2023-05-27 14:06:18 -07:00
Wez Furlong
6b21e6ffde
fixup tests for symbols font changes 2023-05-21 10:07:07 -07:00
Wez Furlong
098e0e0201
fix CopyMode(EditPattern) not activating search_mode key table
refs: #3746
2023-05-21 10:04:56 -07:00
Wez Furlong
281e0e1737
windows: fix overlay/modal shortcuts
Arrow keys have ENHANCED_KEY set in the mods, and shifted keys had
positional mods in things like quickselect.

Strip them out.

I think I got all the cases, but it's possible that one slipped
through.

refs: https://github.com/wez/wezterm/issues/3617
2023-05-20 20:00:24 -07:00
Wez Furlong
e41c4405c7
palette: avoid spurious warning when opening command palette
If you haven't registered an augment-command-palette event,
you'd see:

```
16:29:02.641 WARN wezterm_gui::termwindow::palette >
augment-command-palette: error converting Lua nil to Rust Type (Cannot
convert `Null` to `Vec`)
```

refs: https://github.com/wez/wezterm/issues/3595
2023-05-20 19:54:24 -07:00
Wez Furlong
4ae176dd8a
try scaling down images that don't fit in the texture atlas
When trying to display a 4k image there is a high chance that
we'll run out of texture space and then render with no images
displayed.

This commit changes the binary yes/no allow-images into a a series
of attempts: display at natural size, scale down by 2, 4, then 8,
then give up on images.

While looking at this, I noticed that we had a TOCTOU in the blob lease
stuff in the case where we might very quickly try the handle the same
image in succession, and end up deleting a file out from under a live
lease.

I've put in place a simple bandaid for that, but it's probably worth
revisiting the concurrency model for that.
2023-05-19 08:57:38 -07:00