1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-24 07:46:59 +03:00
Commit Graph

490 Commits

Author SHA1 Message Date
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
548adf484b add wezterm.color.get_default_colors 2022-07-14 21:41:39 -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
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
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
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
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
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
4a4787ff41 add wezterm.json_parse and wezterm.json_encode 2022-07-10 09:30:54 -07:00
Wez Furlong
4a8e2b9e8b cargo update
To silence dependabot about openssl-src
2022-07-06 13:01:57 -07:00
Wez Furlong
a6cf13e1e2 lua: add wezterm.window.screens()
Currently implemented on X11 only, this function returns information
about the geometry of the screen(s).

This is taken from the same source of information we use for the
`--position` CLI argument to `wezterm start`.

```
> wezterm.window.screens()
{
    "by_name": {
        "DisplayPort-1": {
            "height": 2160,
            "name": "DisplayPort-1",
            "width": 3840,
            "x": 0,
            "y": 0,
        },
    },
    "main": {
        "height": 2160,
        "name": "DisplayPort-1",
        "width": 3840,
        "x": 0,
        "y": 0,
    },
    "origin_x": 0,
    "origin_y": 0,
    "virtual_height": 2160,
    "virtual_width": 3840,
}
```
2022-07-06 08:35:05 -07:00
Wez Furlong
3dbd866b06 deps: tiny-skia -> 0.7
closes: #2219
2022-07-04 06:30:34 -07:00
dependabot[bot]
e2eb2b444b build(deps): bump rstest from 0.14.0 to 0.15.0
Bumps [rstest](https://github.com/la10736/rstest) from 0.14.0 to 0.15.0.
- [Release notes](https://github.com/la10736/rstest/releases)
- [Changelog](https://github.com/la10736/rstest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/la10736/rstest/compare/0.14.0...0.15.0)

---
updated-dependencies:
- dependency-name: rstest
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-04 06:24:17 -07:00
Wez Furlong
7b3c855615 cargo update 2022-07-03 22:48:58 -07:00
dependabot[bot]
adc42bd470 build(deps): bump embed-resource from 1.7.2 to 1.7.3
Bumps [embed-resource](https://github.com/nabijaczleweli/rust-embed-resource) from 1.7.2 to 1.7.3.
- [Release notes](https://github.com/nabijaczleweli/rust-embed-resource/releases)
- [Commits](https://github.com/nabijaczleweli/rust-embed-resource/compare/v1.7.2...v1.7.3)

---
updated-dependencies:
- dependency-name: embed-resource
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-03 22:48:13 -07:00
Wez Furlong
f1c53495e7 lua: add window:mux_window() and pane:mux_window() methods
These allow converting the gui versions of these objects
to the mux versions.

refs: https://github.com/wez/wezterm/issues/225
2022-06-27 20:28:26 -07:00
Wez Furlong
65e0bb1dd6 cargo update 2022-06-26 20:40:48 -07:00
Funami580
b29089ebdc support drag and drop files for wayland 2022-06-20 13:25:32 -07:00
dependabot[bot]
43a541a485 build(deps): bump rstest from 0.13.0 to 0.14.0
Bumps [rstest](https://github.com/la10736/rstest) from 0.13.0 to 0.14.0.
- [Release notes](https://github.com/la10736/rstest/releases)
- [Changelog](https://github.com/la10736/rstest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/la10736/rstest/compare/0.13.0...0.14.0)

---
updated-dependencies:
- dependency-name: rstest
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-20 05:23:14 -07:00
Wez Furlong
be8a6e18cc cargo update 2022-06-19 21:40:05 -07:00
Wez Furlong
5bcb0de442 lua: add wezterm.GLOBAL 2022-06-18 21:31:53 -07:00
Wez Furlong
699bbce8e2 add gui-startup and mux-startup events
Using the newly exposed-to-lua mux apis, you may now run some lua code
at GUI startup and/or mux startup, just prior to any default windows
being created.

If you happen to spawn any panes as a result of this, wezterm will
skip creating the default program.

```lua
local wezterm = require 'wezterm'
local mux = wezterm.mux

-- This produces a window split horizontally into three equal parts
wezterm.on("gui-startup", function()
  wezterm.log_info("doing gui startup")
  local tab, pane, window = mux.spawn_window{}
  mux.split_pane(pane, {size=0.3})
  mux.split_pane(pane, {size=0.5})
end)

wezterm.on("mux-startup", function()
  wezterm.log_info("doing mux startup")
  local tab, pane, window = mux.spawn_window{}
  mux.split_pane(pane, {size=0.5, direction="Top"})
end)

return {
  unix_domains = {
    {name="unix"}
  },
}
```

refs: #674
refs: #1949
2022-06-17 12:37:19 -07:00
Wez Furlong
3170f9a13c lua mux: add a couple of window methods 2022-06-17 09:27:28 -07:00
Wez Furlong
e8bb0e03ee add wezterm.mux lua module
The intent is to expose Mux related functions to lua, so `wezterm.mux`
will be that module table.

In order to test this out in the debug overlay, I realized that the
overlay was running functions in a different thread and didn't have
access to the mux, so this commit also tweaks the debug overlay repl to
execute the input in the main thread.

The result is that it is now possible to do
`wezterm.mux.active_workspace()` in the debug overlay to print the
active workspace name.

More functions will follow.

refs: https://github.com/wez/wezterm/issues/225
2022-06-17 07:46:25 -07:00
Wez Furlong
df7c09d760 track dpi in mux and terminal model
refs: https://github.com/wez/wezterm/issues/2085
2022-06-15 18:54:51 -07:00
Wez Furlong
75066cb522 deps: update
Main thing to note here is that the open crate has deprecated
open::that_in_background, but made open::that non-blocking.

I think this is OK, but I'm a little cagey about what will
happen with this on Windows.  We may need to spawn our own
thread for this if things go awry.
2022-06-12 20:17:48 -07:00
Wez Furlong
a0e2a805d9 deps: notify -> 5.0.0-pre.15
This allows moving past a number of outdated deps, but importantly,
allows updating miow to a version that has the correct memory layout
for SocketAddr, and satisfies a dependabot alert.
2022-06-07 23:34:58 -07:00
Wez Furlong
7abc46208d deps: migrate from ratelimit_meter -> governor
This appeases some dependabot warnings regarding the use of
an old version of parking_lot that has some unsoundness issues.

ratelimit_meter is frozen and is succeeded by governor which has
a mostly similar API.
2022-06-07 22:55:01 -07:00
Wez Furlong
4776c8d9d9 deps: cargo update 2022-06-05 22:31:26 -07:00
Wez Furlong
da59a22297 x11: subscribe to Present extension configure notify events
The hope here is that the nvidia-specific resize issue might have
a workaround if it is emitting some other events that we were
previously not listening for.

This commit optionally enables the Present extension and listens
for its version of CONFIGURE_NOTIFY, routing it through the same
logic as the base CONFIGURE_NOTIFY event.

On my AMD hardware under Gnome, I see something like:

```
18:04:26.476  TRACE  window::os::x11::window > Present::ConfigureNotify: width 1168 -> 1180, height 858 -> 873, dpi 124.7998046875 -> 124.7998046875
18:04:26.478  TRACE  window::os::x11::window > Ignoring X::ConfigureNotify (1180x873 dpi=124.7998046875) because width,height,dpi are unchanged
```

with the Present event firing before the X event.

Let's see how this goes.

refs: #2063
refs: #1992
2022-06-03 18:08:51 -07:00
Wez Furlong
80caba1db3 add wezterm shell-completion subcommand to generate shell completions 2022-05-28 07:43:28 -07:00
Wez Furlong
f857ec6a5a deps: structopt -> clap 3 2022-05-28 07:07:52 -07:00
Wez Furlong
0b64d2c7f6 cargo update
My windows build didn't work this morning, complaining:

; cargo build
    Updating crates.io index
error: failed to select a version for the requirement `libgit2-sys = "^0.13.4"`
candidate versions found which didn't match: 0.13.2+1.4.2, 0.13.1+1.4.2, 0.13.0+1.4.1, ...
location searched: crates.io index
required by package `git2 v0.14.4`
    ... which satisfies dependency `git2 = "^0.14"` (locked to 0.14.4) of package `config v0.1.0 (C:\Users\wez\wez-personal\wezterm\config)`
    ... which satisfies path dependency `config` (locked to 0.1.0) of package `codec v0.1.0 (C:\Users\wez\wez-personal\wezterm\codec)`
    ... which satisfies path dependency `codec` (locked to 0.1.0) of package `wezterm v0.1.0 (C:\Users\wez\wez-personal\wezterm\wezterm)`

The cargo update downgraded the dep, but looking at crates.io the
requested revs look ok.  Something is fishy.

I upgraded rust and ran cargo update again to get back on the
same git rev, so now this commit captures the other things
that changed.
2022-05-26 05:37:22 -07:00
Wez Furlong
fe7f3e9214 cargo update 2022-05-23 08:18:06 -07:00
Wez Furlong
efb8d14064 config: avoid rebuilding when git index changes
Focus instead on the head and check whether a commit is made.
2022-05-23 08:16:52 -07:00
Wez Furlong
07128bd0de fixup win32 build 2022-05-19 09:23:32 -07:00
Wez Furlong
0e0bac2576 deps: prune some unused deps 2022-05-19 06:48:09 -07:00
Wez Furlong
2f14d640e8 config: split out lua functions into their own crates
This shaves off some build time and allows more parallism in the build.
2022-05-19 06:48:09 -07:00
Wez Furlong
0b61d41f8f remove serde from bidi 2022-05-18 09:25:41 -07:00
Wez Furlong
92eea8e064 restore pretty printing lua values in repl
This time with more correctly working cycle detection
2022-05-18 07:47:39 -07:00
Wez Furlong
55e7d845e9 Add cycle detection when converting lua values to dynamic 2022-05-18 07:47:39 -07:00
Wez Furlong
862dbc604a cut more things over to dynamic 2022-05-18 07:47:39 -07:00
Wez Furlong
f587cac145 config: cut over to wezterm-dynamic
Avoid using serde for mapping between Lua and Rust for the `Config`
struct.

This improves the build speed of the config crate by 2x; it goes down
from 30 seconds to 9 seconds on my 5950x.
2022-05-18 07:47:39 -07:00
Wez Furlong
24c6830345 add wezterm-dynamic crate 2022-05-18 07:47:39 -07:00
Wez Furlong
3800710ead cargo update 2022-05-15 19:44:27 -07:00
Wez Furlong
e5a483ff8b window: point to re-integrated xkbcommon
refs: https://github.com/rust-x-bindings/xkbcommon-rs/pull/30
2022-05-09 17:24:20 -07:00
Wez Furlong
6484b3adc0 switch macos clipboard crate
This cleans up the `cargo audit` output on linux because the `clipboard`
crate (which hasn't been updated in 3 years) depends on xcb=0.8.2
which is flagged by cargo audit.

We don't use `clipboard` on any platform except macos

This commit switches to the `clipboard_macos` crate; that appears to
use a copy and paste of the macos specific code from the `clipboard`
crate, so this shouldn't have any change in functionality.

refs: https://github.com/wez/wezterm/issues/1952
2022-05-08 21:11:39 -07:00