1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-29 21:44:24 +03:00
Commit Graph

5930 Commits

Author SHA1 Message Date
Wez Furlong
98fb67c029 fix termwiz build 2022-07-11 21:20:31 -07:00
Wez Furlong
c8ca2054f6 lua: add wezterm.color.extract_colors_from_image
This function can be used to extra distinct colors from
an image to be fed into eg: color scheme generation.
2022-07-11 17:46:36 -07:00
Wez Furlong
870ffdf59a ensure that we spawn open calls on a background thread
Otherwise we can block the gui waiting for eg: a freshly opened firefox to
terminate.

See also comment worrying about this in
75066cb522.
That fear was realized but now resolved!

refs: https://github.com/wez/wezterm/issues/2245
2022-07-11 08:03:37 -07:00
Wez Furlong
cfd9c0b364 colors: add RYB based complement
Now you can complement_ryb yellow to arrive at a purple color,
just like you were taught in art class.
2022-07-11 00:18:39 -07:00
Wez Furlong
463ca2fa29 add wezterm.color module for working with colors
wezterm.color.parse() returns a color object that can be assigned in the
wezterm color config, and that can be used to adjust hue, saturation and
lightness, as well as calculate harmonizing colors (complements, triads,
squares) from the RGB/HSL color wheel.
2022-07-10 23:41:18 -07:00
Wez Furlong
4161e67f60 lua: implicit tostring(userdata) when printing and ToDynamic
I've been holding off from using UserData wrappers around things
because it is awkward to match them up with the To/FromDynamic
conversion.

This commit aims to help with that by implicitly calling the
tostring metamethod (if present) on a userdata both when printing
(so the values look reasonable in the repl) and when mapping a lua
value to a dynamic value.

Provided that the end type is try_from=String this will allow
the userdata value to be assigned as table value.
2022-07-10 21:19:10 -07:00
Wez Furlong
7a5440694d add distro-defaults feature
The intent is that when set, it changes defaults to something
more suitable for distributions.

I've also added a readme for distro maintainers.

refs: https://github.com/wez/wezterm/issues/1795
2022-07-10 16:34:43 -07:00
Davide Cavalca
2dbdfbf124 color-types: add missing license file 2022-07-10 15:48:42 -07:00
Wez Furlong
5939bacf14 Import terminal.sexy themes 2022-07-10 14:33:31 -07:00
Wez Furlong
79d4a7bcc0 fmt 2022-07-10 13:37:01 -07:00
Wez Furlong
e866e9390a colorschemes: expand to include Gogh color schemes
This commit expands the toml file definition to include
metadata for the origin url, author and name.

A new sync utility fills out that metadata when it pulls from the iterm2
color schemes repo.

The utility also pulls down the scheme data json maintained by
the Gogh project: https://gogh-co.github.io/Gogh/ and converts
it to wezterm's format.

About 50% of Gogh overlaps with iterm2; we take the iterm2 versions
of those schemes by default because the iterm2 data has more info
about things like cursor and selection colors.

The sync utility is responsible for compiling the de-duplicated
set of scheme data into a form that is used by wezterm and its
docs.
2022-07-10 13:32:17 -07:00
Wez Furlong
54ee1f6aaf unset VTE_VERSION to avoid problems with vte.sh integration
refs: https://github.com/wez/wezterm/issues/2237
2022-07-10 09:38:41 -07:00
Wez Furlong
4a4787ff41 add wezterm.json_parse and wezterm.json_encode 2022-07-10 09:30:54 -07:00
Wez Furlong
c8cb99a512 vtparse: increase MAX_OSC to load dynamic color scripts 2022-07-10 08:36:38 -07:00
Wez Furlong
d7fa541745 windows: fixup starting maximized
Since applying the maximized state is async, we hadn't fully applied
it before we got to the startup logic that resizes the window to fit
the initial terminal size.

This adds a final check to see if we are resizable before we try
to apply that size, and skips it.

refs: #284
2022-07-10 07:19:08 -07:00
Wez Furlong
f11b240a1c wayland: double-buffer ime events
refs: #1772
2022-07-10 06:52:21 -07:00
Wez Furlong
607287935f wayland: ime: clear compose state after commit
refs: #1772
2022-07-09 23:12:43 -07:00
Wez Furlong
ffe76bae3a docs: make color scheme dirs as needed 2022-07-09 23:07:31 -07:00
Wez Furlong
6cc01251dc docs: even more robust idents for colorschemes 2022-07-09 22:59:15 -07:00
Wez Furlong
85d2cb3cfb docs: more robust ident generation for asciinema player 2022-07-09 22:48:57 -07:00
Wez Furlong
93255ac2d9 docs: remove color scheme screenshots 2022-07-09 22:42:08 -07:00
Wez Furlong
1202d7d594 docs: show the number of color schemes 2022-07-09 22:41:26 -07:00
Wez Furlong
2196279689 wayland: workaround mutter IME issue
refs: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4776
refs: https://github.com/wez/wezterm/issues/1772
2022-07-09 22:29:25 -07:00
Wez Furlong
d5060ec3c1 docs: use asciinema's web player for screenshots
I've wanted to avoid checking in all the screenshot pics as the png
files change every time I run the generation script, and it bloats
the repo over time.

This commit changes the doc generation step to use the asciinema
web player with the equivalent contents.

Really, it's only a smallish step to go from this to just emitting
the html directly in the doc pages, but I think I might use
the player for some examples in the future.

I think this is still a fine step for now in any case.

While comparing this with the existing screenshots, I noticed the
the Alabaster screen shot png has the wrong color for its rightmost
column: there's an issue in wezterm in parsing the dynamic color
escapes that causes it to pick up the wrong color.

Loading the scheme by name has the correct color and matches
how it is shown as of this commit.
2022-07-09 18:59:44 -07:00
Wez Furlong
8bad7dee58 wezterm.format: accept "ResetAttributes" to reset attributes 2022-07-09 16:19:30 -07:00
Wez Furlong
af5938d414 gui: fix padding color when there are splits
refs: https://github.com/wez/wezterm/issues/2210
2022-07-09 14:53:21 -07:00
Wez Furlong
48ebbd7991 exec domains: report errors in label function 2022-07-09 12:44:16 -07:00
Wez Furlong
7f6ae3c82d wayland: fixup IME preedit
The done event shouldn't clear the state.

refs: #1772
2022-07-09 12:35:01 -07:00
Wez Furlong
9c758dd203 wayland: fix ime position when scaling > 1
refs: #1772
2022-07-09 12:20:22 -07:00
Wez Furlong
39e727db58 tab bar: invalidate on resize to avoid gaps on the RHS 2022-07-09 10:45:43 -07:00
Wez Furlong
268ff59a9f docs: fixup changelog for https://github.com/wez/wezterm/issues/1620
I copied and pasted the wrong issue into 5913783d1e
2022-07-09 10:32:34 -07:00
Wez Furlong
5913783d1e wayland: fix transparent gap under tab bar
Not sure why this only really showed up with Wayland, because the
issue was that the computed tab bar height ended up being 1 or 2
pixels shorter than the area we had allotted.

This commit resolves it by forcing the height to match, and
then aligning the content to the bottom of that region to avoid
having an undesirable line under the tab.

refs: #1256
2022-07-09 10:29:46 -07:00
Wez Furlong
e2b748a0d4 wayland: initial support for zwp_text_input_v3 / IME
refs: #1772
2022-07-09 09:44:08 -07:00
Wez Furlong
520a8e306f invalid tab bar on scaling changes
refs: #2208
2022-07-09 07:17:03 -07:00
Wez Furlong
dd27e790c8 docs: add wezterm.gui.screens() to changelog 2022-07-09 06:54:55 -07:00
Wez Furlong
29b7524b9d docs: wrap some text 2022-07-08 23:37:28 -07:00
Wez Furlong
95229d3334 add docs for ExecDomain
refs: https://github.com/wez/wezterm/issues/1776
2022-07-08 23:25:42 -07:00
Wez Furlong
b103cc3ebb docs: fix typo and copy pasta 2022-07-08 22:12:16 -07:00
Wez Furlong
c97e8e564e fonts: allow setting assume_emoji_presentation per font
This allows the user to specify what happens if they have an emoji
font that doesn't match our built-in heuristics.
2022-07-08 21:14:16 -07:00
Wez Furlong
b98fb8410b fonts: assume emoji presentation for fonts with "moji" in their name
previously, we'd match "emoji", but that wouldn't match openmoji.
2022-07-08 21:01:35 -07:00
Wez Furlong
f9cfde3b98 docs: changelog for https://github.com/wez/wezterm/pull/2233 2022-07-08 20:51:56 -07:00
Dominik Kreutzer
51c30e2ee2 win32: fix encoding of delete and backspace keys
When using the win32 keyboard encoding, the delete and backspace keys
were encoded with the wrong character codes compared to the native
terminal. This caused subtle issues in multiple applications.

This change brings the encoding in line with the native terminal.
2022-07-08 20:49:19 -07:00
Wez Furlong
686daf7bca wsl_domains: soft-bind to the config definition
Allows config file changes to be reflected
2022-07-08 20:47:07 -07:00
Wez Furlong
0899282ea6 exec_domains: soft-bind to the config definition
This allows config file changes to be reflected
2022-07-08 20:40:26 -07:00
Wez Furlong
93c5a9b3fb docs: note about wezterm.format in launcher menu labels 2022-07-08 20:26:01 -07:00
Wez Furlong
61f01f6ed7 allow parsing attributes from launcher labels 2022-07-08 19:28:33 -07:00
Wez Furlong
8f44dc46d9 exec_domains: allow async callbacks. can now also set label for launcher
The fixup callback can now by async, which makes it possible to use
other async functions in the callback.

There is an additional parameter to wezterm.exec_domain that allows
setting the label that is shown in the launcher menu.
It accepts either a string value or an async callback function
that can be used to compute the label dynamically.
2022-07-08 18:46:09 -07:00
Wez Furlong
c906179bb9 wayland: use zwlr_output_manager if available
This seems to have better names and also returns fractional
scaling information.
2022-07-08 13:40:28 -07:00
Wez Furlong
fdb5fc2d66 wayland: implement wezterm.gui.screens()
Hook it up for resolving geometry, but note that wayland doesn't
allow positioning and we don't expose a way to set width/height
based on screen right now.
2022-07-08 09:54:42 -07:00
Wez Furlong
5c6312c6a5 remove stray debug 2022-07-07 22:44:12 -07:00