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

6806 Commits

Author SHA1 Message Date
Wez Furlong
13aefd22fe
docs: more config.something style adjustments 2023-03-19 18:36:37 -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
060d0f1ed4
remove open dependency
refs: https://github.com/wez/wezterm/issues/3288
2023-03-19 13:12:20 -07:00
Wez Furlong
f5ba73a1a2
add own open_url crate
The upstream open crate keeps making stuff async/blocking/not-working on
windows, so this is a step towards removing this dependency.

refs: https://github.com/wez/wezterm/issues/3288
2023-03-19 12:44:12 -07:00
Wez Furlong
e70ec47134
time: call_after accepts fractional seconds
I thought I'd hooked it up that way from the start, but apparently not!

refs: https://github.com/wez/wezterm/issues/3287
2023-03-19 10:29:19 -07:00
Wez Furlong
402949d787
fix split size after unzooming, when the window size is unchanged
refs: https://github.com/wez/wezterm/issues/3111
refs: https://github.com/wez/wezterm/issues/3068
2023-03-19 09:25:04 -07:00
Wez Furlong
7a6dce3ff0
fix hover state for retro tab bar
Make the math consistent between the hover logic and the render
logic.

refs: https://github.com/wez/wezterm/issues/3113
2023-03-19 09:09:54 -07:00
Jalil David Salamé Messina
d541e2e13d fix(clippy): Remove closures where possible
- Removes closures and function calls for types that implement default:

  ```rust
  // Change
  let _my_str = get_str().unwrap_or(String::new);
  // To
  let _my_str = get_str().unwrap_or_default();
  ```

- Uses the `.cloned()/.copied()` methods where possible
- Use function pointer instead of simple closure

May improve performace, as closures generate more code, and this might
unlock some inlining opportunities.
2023-03-19 08:41:38 -07:00
Jalil David Salamé Messina
191aacc7d7 fix(clippy): Use faster methods on Iterators
- Use `find` instead of `position(..).next()`
- Use `any` instead of `position(..).next().is_some()/.is_none()`
- Use `first/next` instead of `get(0)/nth(0)`
- Prefer `for` loops over `while let` loops on iterators

May improve performance.
2023-03-19 07:29:23 -07:00
Wouter Beeftink
1ccc6c9ce0 Convert admonition blocks to markdown equivalent
Note: the second block had no type specified. I picked `tip` for this one.
2023-03-19 07:25:26 -07:00
Wez Furlong
8e0f9947d2
fix time.call_after when used inside an event callback
```lua
local wezterm = require 'wezterm'

function user_callback_test(window, pane)
  print("user_callback_test()")
  wezterm.time.call_after(3, function()
    print("Hello again, later")
  end)
end

return {
  keys = {
    { mods = 'CTRL|ALT',
      key = 'u',
      action = wezterm.action_callback(user_callback_test)
    }
  }
}
```

refs: https://github.com/wez/wezterm/issues/3026
2023-03-19 07:22:14 -07:00
Wez Furlong
4d471807c3
mouse: don't over invalidate when hovering tabs
refs: #3276
2023-03-19 06:35:17 -07:00
Wez Furlong
c1e9bcba5f
fix non-serde termwiz build 2023-03-18 22:21:42 -07:00
Wez Furlong
4466997b88
clean up blob storage on shutdown
The static OnceCell didn't run destructors, so shift to something
where we can explicitly trigger them to run and clean up the
temporary directory area.
2023-03-18 22:19:46 -07:00
Wez Furlong
344a41f944
use blob leases for decoded animation frames
This allows the decoder thread to live only long enough
to decode the full set of frames; we can then store the
leases in memory and pull them in only when there is
a cache miss.

refs: https://github.com/wez/wezterm/issues/3263
2023-03-18 21:55:57 -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
6c86bfba39
add wezterm-blob-leases crate 2023-03-18 20:30:47 -07:00
Wez Furlong
b27fd84e11
docs: fix video link on features page 2023-03-18 07:36:01 -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
203bd10d8e
handle unsupported images better 2023-03-17 13:52:43 -07:00
Wez Furlong
01c7b30247
cargo update 2023-03-17 12:02:21 -07:00
winston
a394735fa9 fix: rewrite . when fetching path in lua plugin crate
Closes #3194
2023-03-17 11:57:30 -07:00
Wez Furlong
761bd5a4d4
docs: restore foo.html rather than foo/index.html style URLs 2023-03-17 11:47:59 -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
4e7eba36fb
Use mkdocs admonish for note about mux color schemes 2023-03-17 09:29:38 -07:00
Wez Furlong
587ceca98e
term: avoid breaking animated webp images when resizing
refs: https://github.com/wez/wezterm/issues/3258
2023-03-16 22:55:38 -07:00
Wez Furlong
97452d0ccc
term: improve readability of error message for oversized image
refs: https://github.com/wez/wezterm/issues/3264
2023-03-16 22:41:52 -07:00
Wez Furlong
a115fc0df7
fix iterm2 image cursor position
refs: https://github.com/wez/wezterm/issues/3266
2023-03-16 21:53:13 -07:00
Wez Furlong
6237668a14
pages: run only one at a time, allow them to queue up 2023-03-16 21:23:16 -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
c093b8861a
rustfmt 2023-03-16 18:13:30 -07:00
Wez Furlong
c2cf376d8f
fix DisableDefaultAssignment not working for CTRL|SHIFT P
refs: https://github.com/wez/wezterm/issues/3262
2023-03-16 18:08:37 -07:00
Wez Furlong
88e53a5f11
apply reloaded config to all panes, regardless of zoom state
refs: https://github.com/wez/wezterm/issues/3259
2023-03-16 09:31:32 -07:00
Wez Furlong
4576f46828
Set minimum animation frame duration to match max_fps
In #3260, the candidate animation had a frame delay of 1ms.  That is
problematic because there is no hope for wezterm running at 60fps (a
frame delay of ~16ms) to render that without dropping frames.

A consequence of such a short frame delay, coupled with the way that
images are carved up into cells, is that individual cells can easily
become visibled de-synchronized from their neighbors and results in what
looks like mpeg artifacts but are really regions where the cells are a
few frames ahead/behind their neighbors.

The solution is to clamp the frame duration up to match the minimum
displayable frame duration as governed by max_fps.

refs: https://github.com/wez/wezterm/issues/3260
2023-03-16 09:06:59 -07:00
Artyom Nesterenko
d84ccf126e Update Homebrew section 2023-03-16 08:02:46 -07:00
Yuta Katayama
6a012cfc9f docs: Correct to new URL 2023-03-16 08:00:28 -07:00
Jalil David Salamé Messina
cb9dc3a800 fix(clippy): Remove unnecessary clone/to_string calls 2023-03-16 07:40:12 -07:00
Wez Furlong
a22e6fa1ab
fix trigger paths! 2023-03-16 00:05:00 -07:00
Wez Furlong
4f48f03ab9
revise fmt workflow triggers 2023-03-15 23:43:32 -07:00
Wez Furlong
46913b7822
ci: adjust wezterm-ssh triggers 2023-03-15 23:43:32 -07:00
Wez Furlong
914ad42743
revise verify-pages triggers and workflow 2023-03-15 23:43:28 -07:00
Wez Furlong
cf74e7f501
ci: adjust termwiz workflow path triggers 2023-03-15 23:26:32 -07:00
Wez Furlong
f80376b9f6
docs: changelog for https://github.com/wez/wezterm/pull/3146 2023-03-15 23:16:14 -07:00
Jared Baur
2408367e6f Improve XDG configuration searching
In addition to XDG_CONFIG_HOME, use XDG_CONFIG_DIRS
(https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html)
to append paths for searching for configuration files.
2023-03-15 23:11:02 -07:00
Bilal Mahmoud
78e8d90e64 fix: typo about parameter 2023-03-15 22:58:59 -07:00
Wez Furlong
8489f7fd83
docs: make them build on macos again 2023-03-15 22:56:44 -07:00
Wez Furlong
5e5f816f83
add log_unknown_escape_sequences config option 2023-03-15 22:47:32 -07:00
Wez Furlong
cd89022164
docs: don't build now-unused mdbook bits 2023-03-15 21:35:27 -07:00
Wez Furlong
7b2330ead2
ci: workflow should run when its file is changed 2023-03-15 21:34:33 -07:00