1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-24 16:08:34 +03:00
Commit Graph

5983 Commits

Author SHA1 Message Date
Wez Furlong
d15fd7b4db docs: fix parameters to call_after callback 2022-07-18 12:35:36 -07:00
Wez Furlong
dd327617b1 lua: add wezterm.time.call_after and wezterm.reload_configuration
These allow setting up some basic timers and constructing time-dependent
config files.

Needs to be used respsonsibly!
2022-07-18 07:37:41 -07:00
Wez Furlong
c81dabd76b rustfmt 2022-07-17 21:55:39 -07:00
Wez Furlong
1c32ac95bf cargo update
and address deprecation warnings for csscolorparser
2022-07-17 21:14:47 -07:00
Wez Furlong
85fb78d788 lua: add wezterm.time and Time object
Includes a method for determining sunrise/sunset.
2022-07-17 11:38:02 -07:00
Wez Furlong
2b17a64d74 docs: changelog for #2103 #2271 2022-07-17 05:54:18 -07:00
Anomalocaridid
4e2b5cd2cd add --cwd . to desktop file Exec field 2022-07-17 05:50:28 -07:00
Anomalocaridid
a56904e40d change exec command in desktop file 2022-07-17 05:50:28 -07:00
Wez Furlong
fc6cfd1f72 term: fix encoding for modified F1-F4
refs: https://github.com/wez/wezterm/issues/2263
2022-07-16 22:12:26 -07:00
Wez Furlong
5e60743519 lua: add wezterm.procinfo module 2022-07-16 08:49:58 -07:00
Wez Furlong
ec65b64f30 lua: add tostring impls for window, tab and pane objects 2022-07-16 08:22:10 -07:00
Wez Furlong
4e4371a312 docs: clarify what happens when appearance changes 2022-07-16 07:40:48 -07:00
Wez Furlong
30e2a1a6d1 add Catppuccin color schemes
refs: https://github.com/catppuccin/wezterm/issues/6
refs: https://github.com/wez/wezterm/pull/2221
2022-07-16 06:55:37 -07:00
Wez Furlong
910879642f retro tab bar: use resolved palette for colors
This allows tab bar colors to be defined in the toml file and
take effect on the fancy tab bar!

an example can be found at: https://github.com/catppuccin/wezterm/blob/main/dist/catppuccin-frappe.toml

refs: https://github.com/catppuccin/wezterm/issues/6
2022-07-16 06:20:26 -07:00
Wez Furlong
bbd2983bbc schemes: prefer name from metadata when loading toml
refs: https://github.com/catppuccin/wezterm/issues/6
2022-07-16 06:14:18 -07:00
Wez Furlong
73993a60b4 macos: Add com.apple.security.automation.apple-events entitlement
This is necessary for applications spawned via wezterm to be able to
generate apple events.

wezterm already had the text for the authorization prompt in its plist,
but because it was code signed with the default set of entitlements,
macOS didn't bother to prompt.

This commit introduces an explicit set of entitlements and uses those
when signing the executable.

I test this by manually codesigning on my laptop and confirmed that I
could run bbedit from inside wezterm.

I can't directly test the CI version of that flow on my laptop as it may
destroy my keychain if I got something wrong.

We'll have to see if the CI generated build works out!

refs: https://github.com/wez/wezterm/issues/2242

h/t to https://github.com/microsoft/vscode/issues/119787 for
clearly documenting what was needed.
2022-07-15 19:33:30 -07:00
Wez Furlong
2450fed071 fix padding to the right of retro tab bar
refs: https://github.com/wez/wezterm/issues/2210
2022-07-15 18:40:43 -07:00
Wez Furlong
e277183cb9 overlays: handle resize better
We need to actually tell them that the pane has been resized
so now we do.
2022-07-15 16:32:26 -07:00
Wez Furlong
3d616ffb3d color scheme: allow exporting schemes that set index colors
refs: https://github.com/catppuccin/wezterm/issues/6
2022-07-15 15:43:35 -07:00
Magnus Groß
60b5be2b34 x11/wayland: always try the portal for appearance
Right now the initial x11 appearance retrieval uses the specific
connection interface, which completely circumvents the already existing
more complete implementation in x_and_wayland.rs.
The latter implementation is strictly better, because it first attempts
getting the appearance from the XDG desktop portal and then falls back
to the X11 interface.

Before this patch there was a very weird issue for folks using the OS
system dark mode with the following config snippet:

```
color_scheme = scheme_for_appearance(wezterm.gui.get_appearance())
```

The color_scheme on startup would be correct, but there would be a very
weird problem where sometimes wezterm ignores the first time that the
portal notifies about an appearance update.

The source of the bug was an inconsistent retrieval of the appearance
setting:
- The Lua API used the XDG desktop portal
- The internal appearance used the X11 specific connection at startup

For example due to this, the internal appearance variable could have
stored "Dark" from the X11 connection, but the actual appearance from
the XDG desktop portal was "Light".
If then the XDG desktop portal changes to "Dark", the
appearance_changed() method would dismiss the update because
self.appearance was already "Dark".

It is only after that, that the internal inconsistency would have been
solved and following appearance changes would succeed and update the
colorscheme correctly.

To fix this problem, we now use the portal directly in both the x11 and
wayland connections,  which is consistent with the Lua
wezterm.gui.get_appearance() API.

refs: #2258
2022-07-15 15:23:47 -07:00
Wez Furlong
80e72fa46e exec domains: pass paneid to fixup method
This way we can ensure that it is set in the environment
in time for the lua callback to see it.

refs: #1776
2022-07-15 06:44:36 -07:00
Wez Furlong
122ac8a13c docs: fix typos
closes: #2266
2022-07-15 06:39:14 -07:00
Wez Furlong
8484248010 add wezterm.color.save_scheme for exporting color schemes 2022-07-14 23:22:02 -07:00
Wez Furlong
181401a2ca add lua functions for importing color scheme files 2022-07-14 23:03:18 -07:00
Wez Furlong
e566885e7f colors: move wezterm.get_builtin_color_schemes to wezterm.colors.get_builtin_schemes 2022-07-14 21:52:49 -07:00
Wez Furlong
548adf484b add wezterm.color.get_default_colors 2022-07-14 21:41:39 -07:00
Wez Furlong
dba7932e3e add wezterm.gui.get_appearance to retrieve dark mode
This simplifies the "change scheme based on dark mode" example
a lot.  This was previously impossible to do because we didn't
have a lua module associated with the gui until recently, so
the only way to reference a gui-related object was via an
event callback.

refs: https://github.com/wez/wezterm/issues/2258
2022-07-14 16:46:18 -07:00
Wez Furlong
53aef1ac6e fix build; last commit passed cargo check but not cargo build!? 2022-07-14 09:49:07 -07:00
Wez Furlong
df6a6667a4 fonts: allow glyph not found warnings to show after config reload
refs: #2188
2022-07-14 09:07:15 -07:00
Wez Furlong
f9ab69950a color schemes: add version metadata
Record the version in which we first saw a color scheme.
For schemes from iterm2-color-schemes, we just assume that
we've had them forever as it isn't easy to reverse engineer
that metadata.

Everything else is tagged as 'nightly builds only' and I'll update
that to match the version number in the next release.

Newly discovered items will be added with 'nightly builds only'
from this point onwards.
2022-07-14 08:45:29 -07:00
Wez Furlong
0ce5ddbb13 color schemes: remove : splitting for prefix extraction
Originally I had names like `base 16:foo` but wanted `foo` to
sort with `f` rather than `b`, so this prefix extraction
handled that.

I later changed the names to be `foo (base 16)` so we don't
need this.

This moves the `X::Erosion` scheme to sort under `x` where it
feels more natural.

Ensure that scheme_data.rs has a deterministic sort order that
matches the json data.
2022-07-14 07:40:50 -07:00
Wez Furlong
49e3fd4c9e fonts: limit missing glyph notification to once per hour
refs: https://github.com/wez/wezterm/issues/2188
2022-07-14 07:26:04 -07:00
Wez Furlong
49ab340a92 debug overlay: remember last log line globally
It can be confusing to see the same log lines when re-opening
the debug overlay, so this commit remembers the last line
in a global to make that feel more natural.

Because that causes the initial `OpenGL Initialized!` log to
show only in the first instance of the overlay, that log line
is now changed to debug level and the overlay will now
explicitly log the version information, along with some
brief usage text:

```
Debug Overlay
wezterm version: 20220714-001416-810512c2
OpenGL version: AMD BEIGE_GOBY (LLVM 14.0.0, DRM 3.46, 5.18.10-200.fc36.x86_64) 4.6 (Compatibility Profile) Mesa 22.1.3
Enter lua statements or expressions and hit Enter.
Press ESC or CTRL-D to exit
```
2022-07-14 06:53:41 -07:00
Wez Furlong
810512c2c5 colors: refine importer
Adjust importer to read directly from the source .itermcolors
files in the upstream repo.  Extract some author information
from the comments in those files.

All data is now fetched (and cached!) via relatively minimal
http requests rather than requiring a git repo locally.

Also search for .yml files in base16 repos; found another
couple of schemes this way.

The toml files under assets/colors are no longer read by
anything in the repo. I plan to remove them, but since the
docs reference them as examples, I will first ensure that
there are docs and tooling that explains how to write and
share your own scheme files.
2022-07-14 00:14:16 -07:00
Wez Furlong
222853bdc5 color schemes: move other color scheme format code to color-funcs
I want to add lua funcs for importing schemes; this is a step towards
that.
2022-07-13 21:29:51 -07:00
Wez Furlong
a1c8b4a9b3 x11/wayland: subscribe to xdg desktop portal for settings changes
We use this to detect changes in dark mode

refs: https://github.com/wez/wezterm/issues/2258
2022-07-13 18:56:21 -07:00
Wez Furlong
5f8ed00faf docs: fix link discussing subpixel hinting 2022-07-13 17:04:26 -07:00
Wez Furlong
8ef70d1e31 windows: avoid recursing and borrowing inner twice
Querying the window can call into windowproc so we need to avoid
it when we hold `inner`.  Adjust the flow so that we can get
the info about the window state purely from an HWND.

refs: #2257
2022-07-13 11:37:04 -07:00
Wez Furlong
8dcfbc6718 x11/wayland: use xdg desktop portal settings interface to get dark mode
There are some other settings in there that could also help with
things like the cursor theme on Wayland.

Note that we don't currently subscribe to the settings changed
signal: that can be done in a follow up.

refs: https://github.com/wez/wezterm/issues/2258
refs: https://github.com/wez/wezterm/issues/1742
2022-07-13 08:55:43 -07:00
Muhammed Zakir
fede46f6b7 Fix shortcut for "move between panes": shift was missing 2022-07-12 22:42:35 -07:00
Wez Furlong
c6ca88f40b docs: show how to find just the dark color schemes 2022-07-12 21:35:05 -07:00
Wez Furlong
7c5c633668 docs: clarify order of extracted colors 2022-07-12 17:13:46 -07:00
Wez Furlong
1a5fdb41da docs: changelog for https://github.com/wez/wezterm/issues/2234 2022-07-12 17:08:06 -07:00
Funami580
cfa95db0cc lua: add pane:is_alt_screen_active() 2022-07-12 17:06:16 -07:00
Wez Furlong
d4d33369f2 color schemes: import all official base16 schemes 2022-07-12 11:51:19 -07:00
Wez Furlong
150732a17d sync-color-schemes: refactor caching and fetching 2022-07-12 10:08:49 -07:00
Wez Furlong
48646ca1d1 sync-color-schemes: refactor 2022-07-12 09:49:01 -07:00
Wez Furlong
179ec9faaf wezterm.mux.set_active_workspace now updates the gui
Attach the mux events to the frontend workspace reconciliation function
so that the window is updated to match the new workspace.

Ensure that we correctly clear out any overlay panes as part of the
switch: we need to remove them from the mux so that the mux will
correctly identify that the mux is empty when the main panes from
the workspace are closed.  The problem case was that the debug overlay
state was forgotten by the gui when activating the new workspace, but
we didn't tell the mux to kill it off, so subsequently CTRL-D'ing
the windows closed the windows but left the wezterm process running with
no head.

refs: #2248
2022-07-12 09:15:38 -07:00
Wez Furlong
a1cb7a2a88 dynamic: add validate attribute, validate line_height.
It's now possible to specify a validation function for config
items.

Use that to validate line_height:

```
; ./target/debug/wezterm --config line_height=-1
08:41:10.576  ERROR  wezterm > Error converting lua value from overrides to Config struct: Error processing Config::line_height: Illegal value -1 for line_height; it must be positive and greater than zero!; terminating
```

refs: https://github.com/wez/wezterm/issues/2247
2022-07-12 08:41:42 -07:00
Wez Furlong
79d2f8197b quickselect: select bottom-most match
We don't really know which of the on-screen matches the user was
looking at when they selected the text, but assume that the one
nearest the bottom of the viewport is the one they want to select,
rather than the one closest to the top.

refs: https://github.com/wez/wezterm/issues/2250
2022-07-12 08:17:14 -07:00