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

6000 Commits

Author SHA1 Message Date
Wez Furlong
2b3d8c1a30 wezterm cli: --workspace requires --new-window
so have the arg parser raise an error if used without it:

```
; wezterm cli spawn --workspace foo
error: The following required arguments were not provided:
    --new-window

USAGE:
    wezterm cli spawn --new-window --workspace <WORKSPACE>

For more information try --help
```

refs: https://github.com/wez/wezterm/issues/2248#issuecomment-1192119746
2022-07-21 19:44:16 -07:00
Wez Furlong
34f87a9be5 add ClearScrollback example that adds CTRL-L after clearing
refs: https://github.com/wez/wezterm/issues/2290
2022-07-21 19:35:52 -07:00
Wez Furlong
67ae0e021f fix tab x button being obscured by tab title text
Need to explicitly pop it in front of the tab text layer so that
the button is physically rendered on top of the tab title.

refs: https://github.com/wez/wezterm/issues/2269
2022-07-21 18:51:21 -07:00
digitallyserviced
41ee60c97a add gelatyx to verify-pages workflow 2022-07-20 07:45:34 -07:00
Wez Furlong
50d5f94ab0 color schemes: add alias concept
Various color schemes have been duplicated as they have been added to
different scheme collections.  They don't always have identical names
(eg: some remove spaces) and sometimes they have very different names
(eg: _bash vs. nightfox, or Miu vs. Blazer).

We already detected duplicates from different collections but previously
we would omit those dupes.

This commit allows us to track those duplicates by recording their
aliases.

When we write out our data, we only include "interesting" alias names;
those where the name isn't trivially identical.

Some scheme collections (eg: iterm2 color schemes) have duplicates
(eg: zenbones and zenbones_light are identical) and we have previously
shipped with both of those names, so we special case to emit dupes
for which we have prior version information in order to avoid
breaking backwards compatibility for our users.

In the doc generation we can generate links to the aliases if we
included them, but also note about the other names and how we don't
include them.  That is so that someone searching the docs for say
"_bash" can discover that it is actually a duplicate of "nightfox" and
use nightfox instead.
2022-07-20 07:32:46 -07:00
Wez Furlong
ffb6ea76cd sync nightfox color schemes
note that "_bash (Gogh)" is removed by this as it is actually
a duplicate of nightfox but with a different name, according
to my dedup logic.

I may add a way to express aliases as a followup.

refs: https://github.com/EdenEast/nightfox.nvim/pull/184
refs: https://github.com/EdenEast/nightfox.nvim/issues/183
refs: https://github.com/EdenEast/nightfox.nvim/issues/156
2022-07-20 05:40:06 -07:00
Wez Furlong
badfae7d23 gui-startup event now accepts SpawnCommand
This allows the hook to choose how to handle eg: `wezterm start -- top`.
Previously, if you had implemented this event you would essentially lose
the ability to specify a command that you wanted to launch.

refs: https://github.com/wez/wezterm/issues/284
2022-07-19 19:45:27 -07:00
Wez Furlong
77b6870ff3 config: revert taking name from the first comment line of toml color scheme files
I needed this while swinging through to the new color scheme data stuff,
but I don't need it any more, and it causes problems with external toml
files.
2022-07-19 12:02:23 -07:00
Wez Furlong
ec59fb6597 docs: changelog for #2253 #2273 2022-07-19 08:00:26 -07:00
Wez Furlong
e0ea0f46a8 docs: apply stylua formatting
refs: https://github.com/wez/wezterm/pull/2273
refs: https://github.com/wez/wezterm/issues/2253
2022-07-19 07:54:31 -07:00
Wez Furlong
7bd41772ab docs: fix lua syntax 2022-07-19 07:35:52 -07:00
Wez Furlong
98dd864df1 docs: split MuxPane 2022-07-19 07:20:11 -07:00
Wez Furlong
f5ee95d582 docs: fix lua syntax issues 2022-07-19 07:12:25 -07:00
Wez Furlong
713450156c docs: only try to format tracked files
Don't format generated docs; their inputs should be formatted instead.

refs: https://github.com/wez/wezterm/pull/2273
refs: https://github.com/wez/wezterm/issues/2253
2022-07-19 06:58:22 -07:00
azzamsa
be929db374 docs: reformat lua code
refs: https://github.com/wez/wezterm/pull/2273
refs: https://github.com/wez/wezterm/issues/2253
2022-07-19 06:27:33 -07:00
Wez Furlong
aee66daccb key table activation timeout is now reset on matching key presses
refs: https://github.com/wez/wezterm/issues/1129
2022-07-19 06:18:26 -07:00
Wez Furlong
112feb3374 add MuxTab:set_zoomed and SetPaneZoomState keyassignment
refs: #2284
2022-07-19 05:52:38 -07:00
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