63 Commits
Author SHA1 Message Date
HomerandClaude Fable 5.2 593df939b9 LLeMbas TTY is LLeMbas TERM: the names, what is carried over, three keys, and the keys LLeMbas IDE has too
llembas-term / linux (push) Canceled after 0s
The rename. Commands llembas-term, -gui, -mux-server, -setup; package llembas-term
(Replaces, Conflicts and Provides llembas-tty, so installing it removes the old one);
directories llembas-term; application id eu.llembas.term; the variables a pane sees
LLEMBAS_TERM…; the status record llembas-term-status=1, the input mark
llembas-term-input=1, the user variable llembas_term_status; the shell integration
llembas-term.sh; the workflow llembas-term.yml; every changed upstream block is marked
"LLeMbas TERM:". The terminal needs the engine's terminal contract 4 and says so in
words with an older CLI.

Carried over from the earlier name: the variables LLEMBAS_TTY… of a terminal that
started this one are dropped; a configuration file of the old name is read where it
is while there is none of the new, with a warning; command-history and
settings-chosen are copied once into a data directory that does not exist yet
(llembas-line::migrate); the set-up program prints the new line for an rc file that
has the old one.

Keys. Ctrl+Tab on the ask line switches the mode (the next tab anywhere else);
Ctrl+Shift+M and Ctrl+Alt+M open the lists of chat and autocomplete models, also
over the ask line, which then says the choice. In a pane where LLeMbas IDE says it
is in front (user variable llembas_ide=1) the chords both have are sent on to it as
the keyboard protocol's bytes and the terminal does nothing of its own; the
terminal's palette is also on Ctrl+Shift+Alt+P. The built-in configuration honours
the kitty keyboard protocol for a program that asks for it.

CI: the .deb is installed over the released llembas-tty 1.0.0-beta.5; keys are
pressed in a real window on Xvfb (not a gate).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-12-02 20:26:37 +00:00
HomerandClaude Fable 5.2 f3d4fe413c Identity: own names, directories, variables and app id
LLeMbas TTY installs and runs beside WezTerm without touching it:

- binaries llembas-tty, llembas-tty-gui, llembas-tty-mux-server (packages keep
  upstream's names);
- configuration in $XDG_CONFIG_HOME/llembas-tty/llembas-tty.lua or
  ~/.llembas-tty.lua; own data, cache and runtime directories;
- LLEMBAS_TTY_CONFIG_FILE / _CONFIG_DIR / _UNIX_SOCKET / _PANE / _EXECUTABLE
  replace the WEZTERM_ ones, which are neither read nor passed on, so neither
  program talks to the other's panes;
- window class, app id, notification id and bundle id eu.llembas.tty;
- panes get LLEMBAS_TTY=<version>; TERM_PROGRAM stays WezTerm;
- --version shows our version and the WezTerm version it is based on;
- the update check, which asks about WezTerm's releases, is off by default.

The LLeMbas layer (llembas/lua) is compiled in and offered as
require 'llembas'; with no configuration file the built-in one applies it.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-12-01 19:15:13 +00:00
xtqqczze 7d0eb9685c wezterm-mux-server: replace winapi with windows-sys (#8224) 2026-11-25 18:20:40 +01:00
xtqqczze 092dcf70d8 style: Add newline after inner attribute for readability (#8130)
Add a newline after inner attributes to make it clear that the
attribute applies to the enclosing item rather than the following item.
2026-09-05 15:31:29 +02:00
Benoit de Chezelles ec1bf1fbbf deps: bump all deps using cargo-cooldown
Change report:
```
    Updating anyhow v1.0.102 -> v1.0.104
    Updating arrayvec v0.7.6 -> v0.7.8
    Updating async-trait v0.1.89 -> v0.1.91
    Removing base64 v0.21.7
     Keeping base64 0.13.1
     Keeping base64 0.22.1
    Updating benchmarking v0.4.13 -> v0.4.15
    Removing bitflags v2.11.1
      Adding bitflags v2.13.1
     Keeping bitflags 1.3.2
    Updating bstr v1.12.1 -> v1.13.0
    Updating bytemuck v1.25.0 -> v1.25.2
    Updating bytemuck_derive v1.10.2 -> v1.11.0
    Updating bytes v1.11.1 -> v1.12.1
    Updating camino v1.2.2 -> v1.2.4 (latest: v1.2.5)
    Updating cc v1.2.63 -> v1.3.0 (latest: v1.4.0)
    Updating cfg_aliases v0.2.1 -> v0.2.2
    Updating chacha20 v0.10.0 -> v0.10.1
    Updating chrono v0.4.44 -> v0.4.45
    Updating clap v4.6.1 -> v4.6.2 (latest: v4.6.5)
    Updating clap_builder v4.6.0 -> v4.6.2 (latest: v4.6.5)
    Updating clap_complete v4.6.5 -> v4.6.7 (latest: v4.6.8)
     Keeping clap_derive 4.6.1 (latest: v4.6.4)
    Updating crossbeam-channel v0.5.15 -> v0.5.16
    Updating crossbeam-deque v0.8.6 -> v0.8.7
    Updating crossbeam-epoch v0.9.18 -> v0.9.20
    Updating crossbeam-queue v0.3.12 -> v0.3.13
    Updating crossbeam-utils v0.8.21 -> v0.8.22
      Adding defmt v1.1.1
      Adding defmt-macros v1.1.1
      Adding defmt-parser v1.0.0
     Keeping displaydoc 0.2.6 (latest: v0.2.7)
     Keeping either 1.16.0 (latest: v1.17.0)
    Updating env_filter v1.0.1 -> v2.0.0
    Removing env_logger v0.11.10
      Adding env_logger v0.11.11
     Keeping env_logger 0.10.2
     Keeping event-listener 5.4.1 (latest: v5.4.2)
    Updating exr v1.74.0 -> v1.74.2
    Updating fastrand v2.4.1 -> v2.5.0
     Keeping foreign-types-macros 0.2.3 (latest: v0.2.4)
    Updating futures v0.3.32 -> v0.3.33
    Updating futures-channel v0.3.32 -> v0.3.33
    Updating futures-core v0.3.32 -> v0.3.33
    Updating futures-executor v0.3.32 -> v0.3.33
    Updating futures-io v0.3.32 -> v0.3.33
    Updating futures-macro v0.3.32 -> v0.3.33
    Updating futures-sink v0.3.32 -> v0.3.33
    Updating futures-task v0.3.32 -> v0.3.33
    Updating futures-util v0.3.32 -> v0.3.33
    Removing getrandom v0.4.2
      Adding getrandom v0.4.3
     Keeping getrandom 0.2.17
     Keeping getrandom 0.3.4
     Keeping glob 0.3.3 (latest: v0.3.4)
    Updating globset v0.4.18 -> v0.4.19
    Updating gpu-alloc v0.6.0 -> v0.6.2
    Updating gpu-alloc-types v0.3.0 -> v0.3.1
    Updating h2 v0.4.14 -> v0.4.15
    Updating hdrhistogram v7.5.4 -> v7.6.0
    Updating http v1.4.1 -> v1.4.2 (latest: v1.5.0)
    Updating http-body v1.0.1 -> v1.1.0
    Updating http-body-util v0.1.3 -> v0.1.4
    Updating humantime v2.3.0 -> v2.4.0
     Keeping hyper 1.10.1 (latest: v1.11.0)
    Removing id-arena v2.3.0
    Updating ignore v0.4.25 -> v0.4.30 (latest: v0.4.31)
    Updating imgref v1.12.1 -> v1.12.2
    Updating inotify-sys v0.1.5 -> v0.1.8
     Keeping ipnet 2.12.0 (latest: v2.12.1)
    Updating jiff v0.2.28 -> v0.2.34 (latest: v0.2.35)
      Adding jiff-core v0.1.0
    Updating jiff-static v0.2.28 -> v0.2.34 (latest: v0.2.35)
    Updating jobserver v0.1.34 -> v0.1.35
    Updating js-sys v0.3.99 -> v0.3.103
    Updating kqueue v1.1.1 -> v1.2.0
    Updating leb128 v0.2.6 -> v0.2.7
    Removing leb128fmt v0.1.0
     Keeping libc 0.2.186 (latest: v0.2.189)
     Keeping libflate 2.3.0 (latest: v2.3.1)
    Updating libfuzzer-sys v0.4.12 -> v0.4.13
     Keeping libgit2-sys 0.18.5+1.9.4 (latest: v0.18.7+1.9.6)
    Updating libredox v0.1.17 -> v0.1.18 (latest: v0.1.19)
    Updating libssh2-sys v0.3.1 -> v0.3.2
    Updating libz-sys v1.1.28 -> v1.1.29
    Updating log v0.4.30 -> v0.4.33
    Updating memchr v2.8.1 -> v2.8.3
    Removing memmap2 v0.9.10
      Adding memmap2 v0.9.11
     Keeping memmap2 0.8.0
    Removing mio v1.2.1
      Adding mio v1.2.2
     Keeping mio 0.8.11
    Updating num-bigint v0.4.6 -> v0.4.8
    Updating num-iter v0.1.45 -> v0.1.46
    Updating openssl v0.10.80 -> v0.10.81
    Updating openssl-src v300.6.0+3.6.2 -> v300.6.1+3.6.3
    Updating openssl-sys v0.9.116 -> v0.9.117
    Updating pest v2.8.6 -> v2.8.7 (latest: v2.8.8)
    Updating pest_derive v2.8.6 -> v2.8.7 (latest: v2.8.8)
    Updating pest_generator v2.8.6 -> v2.8.7 (latest: v2.8.8)
    Updating pest_meta v2.8.6 -> v2.8.7 (latest: v2.8.8)
    Updating portable-atomic v1.13.1 -> v1.14.0
    Removing prettyplease v0.2.37
    Updating proc-macro2 v1.0.106 -> v1.0.107
      Adding pulp v0.22.3
      Adding pulp-wasm-simd-flag v0.1.1
    Updating pxfm v0.1.29 -> v0.1.30
    Updating quote v1.0.45 -> v1.0.47
    Removing rand v0.8.6
    Removing rand v0.9.4
    Removing rand v0.10.1
      Adding rand v0.8.7
      Adding rand v0.9.5
      Adding rand v0.10.2
      Adding raw-cpuid v11.6.0
      Adding reborrow v0.5.5
    Removing redox_syscall v0.8.0
      Adding redox_syscall v0.9.0
     Keeping redox_syscall 0.5.18
    Updating regex v1.12.3 -> v1.13.1
    Updating regex-automata v0.4.14 -> v0.4.16
    Updating regex-syntax v0.8.10 -> v0.8.11
    Updating rustc-demangle v0.1.27 -> v0.1.28
    Removing rustc-hash v2.1.2
      Adding rustc-hash v2.1.3
     Keeping rustc-hash 1.1.0
    Updating rustls v0.23.40 -> v0.23.42 (latest: v0.23.43)
    Updating rustls-pki-types v1.14.1 -> v1.15.0 (latest: v1.15.1)
    Updating rustversion v1.0.22 -> v1.0.23
    Updating serde v1.0.228 -> v1.0.229
    Updating serde_core v1.0.228 -> v1.0.229
    Updating serde_derive v1.0.228 -> v1.0.229
     Keeping serde_json 1.0.150 (latest: v1.0.151)
    Updating serde_repr v0.1.20 -> v0.1.21
     Keeping serial2 0.2.37 (latest: v0.2.38)
    Updating sha1 v0.10.6 -> v0.10.7
    Updating simd-adler32 v0.3.9 -> v0.3.10
    Updating smallvec v1.15.1 -> v1.15.2
    Updating smawk v0.3.2 -> v0.3.3
    Removing socket2 v0.6.4
      Adding socket2 v0.6.5
     Keeping socket2 0.5.10
    Updating spin v0.9.8 -> v0.9.9
    Updating ssh2 v0.9.5 -> v0.9.6
    Removing syn v2.0.117
      Adding syn v2.0.119
      Adding syn v3.0.1
     Keeping syn 1.0.109
    Removing thiserror v2.0.18
      Adding thiserror v2.0.19
     Keeping thiserror 1.0.69
    Removing thiserror-impl v2.0.18
      Adding thiserror-impl v2.0.19
     Keeping thiserror-impl 1.0.69
    Updating time v0.3.47 -> v0.3.53 (latest: v0.3.55)
    Updating time-core v0.1.8 -> v0.1.9
    Updating time-macros v0.2.27 -> v0.2.31 (latest: v0.2.32)
    Updating tinyvec v1.11.0 -> v1.12.0
    Updating tokio v1.52.3 -> v1.53.0 (latest: v1.53.1)
    Updating tokio-macros v2.7.0 -> v2.7.1 (latest: v2.7.2)
     Keeping tokio-util 0.7.18 (latest: v0.7.19)
    Removing toml_edit v0.25.12+spec-1.1.0
      Adding toml_edit v0.25.13+spec-1.1.0
     Keeping toml_edit 0.22.27
     Keeping toml_parser 1.1.2+spec-1.1.0 (latest: v1.1.3+spec-1.1.0)
    Updating unicode-segmentation v1.13.2 -> v1.13.3
    Removing unicode-xid v0.2.6
    Updating uuid v1.23.2 -> v1.24.0
    Updating wasip2 v1.0.3+wasi-0.2.9 -> v1.0.4+wasi-0.2.12
    Removing wasip3 v0.4.0+wasi-0.3.0-rc-2026-01-06
    Updating wasm-bindgen v0.2.122 -> v0.2.126
    Updating wasm-bindgen-futures v0.4.72 -> v0.4.76
    Updating wasm-bindgen-macro v0.2.122 -> v0.2.126
    Updating wasm-bindgen-macro-support v0.2.122 -> v0.2.126
    Updating wasm-bindgen-shared v0.2.122 -> v0.2.126
    Removing wasm-encoder v0.244.0
    Removing wasm-metadata v0.244.0
    Removing wasmparser v0.244.0
     Keeping wayland-backend 0.3.15 (latest: v0.3.16)
     Keeping wayland-client 0.31.14 (latest: v0.31.15)
    Updating wayland-protocols v0.32.12 -> v0.32.13
     Keeping wayland-scanner 0.31.10 (latest: v0.31.11)
    Updating web-sys v0.3.99 -> v0.3.103
    Removing winnow v1.0.3
      Adding winnow v1.0.4
     Keeping winnow 0.7.15
    Removing wit-bindgen v0.51.0
     Keeping wit-bindgen 0.57.1
    Removing wit-bindgen-core v0.51.0
    Removing wit-bindgen-rust v0.51.0
    Removing wit-bindgen-rust-macro v0.51.0
    Removing wit-component v0.244.0
    Removing wit-parser v0.244.0
     Keeping xcursor 0.3.10 (latest: v0.3.11)
    Updating yoke v0.8.2 -> v0.8.3
    Updating zerocopy v0.8.50 -> v0.8.54 (latest: v0.8.55)
    Updating zerocopy-derive v0.8.50 -> v0.8.54 (latest: v0.8.55)
    Updating zeroize v1.8.2 -> v1.9.0
    Updating zmij v1.0.21 -> v1.0.23
```

openssl deprecation is confirmed: https://github.com/rust-openssl/rust-openssl/pull/2652
2026-08-04 08:35:27 +02:00
Wez Furlong edcdefda3b workspace-ify the deps
There have been a couple of attempts at this in the past, which
had some usability warts in what I recall as an earlier, less
useful set of features overall.

Whether that was collective misunderstanding at the time, or things
have gotten better since then, now is a good time to adopt the workspace
dep syntax, because wezterm has many crates to keep on top of, and
automation like dependabot can't see a lot of them.

This will help to manage the versions of deps in wezterm centrally.

Let's try this out in CI: the Cargo.lock changes here are minimal
(eliminated a second version of base64 from one crate, terminal_size
from another, and removed an explicit dep on serde_derive) so
hopefully this sails through on !linux.

closes: https://github.com/wezterm/wezterm/pull/6668
2025-02-12 09:43:36 -07:00
Wez Furlong 11c4b11669 s,wez/wezterm,wezterm/wezterm,
I moved the repo to an org of its own. Update various things
to reference the new location.
2025-02-07 13:08:01 -07:00
Wez Furlong ff4528e783 fix: blob leases could be broken by tmpwatch
Let's put them in an application-specific cache directory
location instead.

refs: #5422
2024-07-14 07:10:17 -07:00
Wez Furlong 14d426fea8 add cargo deny config, update lru 2024-05-13 08:29:36 -07:00
Wez Furlong 0711455135 add default_ssh_auth_sock option
This is useful (essential!) for fixing up the default auth sock
under gnome, as we do not have a way to do that via whatever
logic may be present in the shell startup files.
2024-05-09 14:27:03 -07:00
Wez Furlong a77ff4b846 fix some warnings with newer rust
The warning is that some of the variants are never read.
In the case of ftwrap, they are referenced via ffi.
For the other locations, we want them for debug purposes.
2024-04-28 19:54:54 -07:00
Wez Furlong 4f123a461b macos (mostly): try harder to get initial dpi
There are a number of open issues that relate to getting the dpi
wrong when spawning a window. In theory it shouldn't matter because
we will immediately realize the difference and synthesize the correct
information, but evidence shows this isn't quite true.

What this commit does is:

* Override Connection::default_dpi() on macOS to return the
  effective_dpi from the active screen instead of the default
  non-retina dpi
* Adjust the Config::initial_size() method to accept an optional
  cell pixel dimension
* Add a helper function to wezterm-gui to compute the cell pixel
  dimensions given the config and the (usually default) dpi, and
  feed that through to Config::initial_size
* in the macos window impl, scale the computed geometry based on
  the ratio of the Connection::default_dpi and the default non-retina
  dpi.

This helps to avoid needing to do a fixup in the
https://github.com/wez/wezterm/issues/4966 case, and may help with
the various other macos quirky issues.

refs: https://github.com/wez/wezterm/issues/2958
refs: https://github.com/wez/wezterm/issues/3575
refs: https://github.com/wez/wezterm/issues/3900
refs: https://github.com/wez/wezterm/issues/4250
refs: https://github.com/wez/wezterm/issues/4285
refs: https://github.com/wez/wezterm/issues/4447
refs: https://github.com/wez/wezterm/issues/4851
refs: https://github.com/wez/wezterm/issues/4966
2024-02-06 22:57:05 -07:00
Wez Furlong 0499ab0430 mlua 0.9 is now stable; update 2023-08-17 09:26:47 -07:00
Wez Furlong 750f49f0ae deps: upgrade mlua to 0.9.0-rc.1
refs: https://github.com/khvzak/mlua/issues/291
refs: #3849
2023-07-12 14:14:55 -07:00
Wez Furlong c7ff432581 mux server: register additional domains
Relocate the helper function to mux-server-impl and have both the GUI
and the mux server call it at the appropriate times.

Introduce default_mux_server_domain which is used instead of
default_domain in the mux server.  This is to avoid recursive
cycles when starting up the mux; we don't want the default
domain to be a unix client that connects to our selves because
we'll try to connect to ourselves, then in act of handling that
spawn in the default domain and try to connect to ourselves and
repeat.

refs: https://github.com/wez/wezterm/issues/3907
2023-07-11 09:34:34 -07:00
Wez Furlong 338174b430 mux: fix pid file locking
This got broken around the time we started to re-exec the mux
server.  Since the fd was CLOEXEC we'd essentially unlock and
ignore the lock at the point we'd re-exec.

This commit allows the fd to remain open and locked across
the exec, and causes the exec'd process to set CLOEXEC by
explicitly telling it about the log fd, so that shells and
things spawned by the mux don't hold the lock.
2023-03-29 06:10:11 -07:00
Wez Furlong ea92df9486 mux server: propagate config CLI options when daemonizing
refs: #3397
2023-03-29 05:40:15 -07:00
Wez Furlong 9fc762a66b fix build.rs on windows, take 2
refs: https://github.com/wez/wezterm/issues/3390
2023-03-28 19:45:52 -07:00
Wez Furlong d5e5bf43d1 fix build.rs on windows
refs: https://github.com/wez/wezterm/issues/3390
2023-03-28 19:32:12 -07:00
Wez Furlong 8092886146 windows: add manifest to config-using console apps, force UTF8 ACP
Lua appears to populate package.path to something based on the
executable path on windows, but since it uses msvcrt in ANSI mode,
that string is encoded in whatever 8-bit MBCS is configured by
the host system ACP setting.

Rust expects that to be UTF-8, but Windows doesn't guarantee it.

This commit updates the manifest for wezterm-gui to tell Windows
that it wants its ACP to be set to UTF-8 prior to launch, which
should resolve this situation for the GUI.

This commit also introduces a more cut-down manifest for the
console-subsystem executables that also use the lua config layer,
which should hopefully resolve this issue for them.

This commit was authored on a mac, so fingers crossed that it
even compiles properly on windows!

refs: https://github.com/wez/wezterm/issues/3390
2023-03-28 19:18:48 -07:00
Wez Furlong a7fde7935b raise ulimit nofile and nproc to a reasonable min value on unix systems
It's a tremendous PITA for the user to do this at the system level on a
mac, where it is sorely needed.  This commit allows raising to a desired
minimum level, but won't decrease from an already larger soft limit.

refs: https://github.com/wez/wezterm/discussions/3353
2023-03-28 07:29:47 -07:00
Wez Furlong bc7acc18e0 fixup images with the multiplexer
* Translate from File to EncodedFile as needed
* Adopt blob leases in the mux server
* Fix an issue where the first image sent by the mux server would
  be replaced on the client by its background image, if configured.
  Removed the ImageData::id field to resolve this: you should use
  the hash field instead to identify and disambiguate images.
  Bumped the termwiz API version because this is conceptually
  a breaking change to the API

refs: https://github.com/wez/wezterm/issues/3343
2023-03-23 21:43:28 -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
Wez Furlong 2b298f5f96 mux: pass gui window position through from new mux window
Threads through a GuiPosition from mux window creation to allow it to be
used when the corresponding gui window is created.

SpawnCommand now has an optional position field to use for that purpose.

```lua
wezterm.mux.spawn_window {
  position = {
    x = 10,
    y = 300,
    -- Optional origin to use for x and y.
    -- Possible values:
    -- * "ScreenCoordinateSystem" (this is the default)
    -- * "MainScreen" (the primary or main screen)
    -- * "ActiveScreen" (whichever screen hosts the active/focused window)
    -- * {Named="HDMI-1"} - uses a screen by name. See wezterm.gui.screens()
    -- origin = "ScreenCoordinateSystem"
  },
}
```

refs: https://github.com/wez/wezterm/issues/2976
2023-02-05 21:43:37 -07:00
Wez Furlong 02eb0b4294 mux: rename Mux::get() -> try_get(), add "infallible" Mux::get()
This allows removing a bunch of unwrap/expect calls.

However, my primary motive was to replace the cases where we used
Mux::get() == None to indicate that we were not on the main thread.

A separate API has been added to test for that explicitly rather than
implicitly.
2022-12-19 11:55:35 -07:00
Wez Furlong 478cc59be3 mux: Mux is now Send+Sync 2022-12-19 11:54:02 -07:00
Wez Furlong a050849695 deps: update to clap 4
Deal with some breaking changes
2022-10-04 08:55:31 -07:00
Wez Furlong de89d650a3 cargo update 2022-08-21 08:51:16 -07:00
Wez Furlong 347e1fdc46 completions: improve zsh completions for --cwd, --config-file, prog
Make these complete the appropriate type of thing
2022-06-19 16:27:59 -07:00
Wez Furlong 66033e4c6d lua api: improve error handling
Don't prevent wezterm from starting up if the gui-startup event
errors out.

Show a toast notification with the error message.

refs: #674
2022-06-18 07:25:05 -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 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 f857ec6a5a deps: structopt -> clap 3 2022-05-28 07:07:52 -07:00
Wez Furlong da7da888cd config: generate errors for things like --config tarm=foo
Invalid option names, or values that evaluate as nil (such as the `foo`
above: that's treated as a global variable reference, but `foo` isn't a
defined global and evaluates as `nil`) will now cause the program
startup to error out with an actionable error message.

Previously, the invalid config name would generate a warning, and the
invalid value would silently have no effect as it has the same effect as
omitting the named value and leaving it as its default value.

I think these cases should both immediately error out and stop
further processing, so that's what we're doing.

This commit also adds support for adding:

```
   #[dynamic(deprecated = "use newer option instead")]
   pub some_config_value: bool,
```

but not options currently use this.
2022-05-21 13:10:30 -07:00
Wez Furlong 03d8f10d11 mux: pass current window_id to Domain::attach
This commit allows the currently active window to:

* Spawn a new tab in the active window (rather than spawning
  a new window) to host the connection status
* Auto-close that connection UI tab (rather than the whole window)
  when the window is no longer needed
* Pass the current window through to use as the primary window when
  assigning remote window/tabs.

The net effect of this is that there are fewer transient windows,
and that it is easier to connect a set of domains to the active
workspace.

refs: https://github.com/wez/wezterm/issues/1874
2022-04-17 18:07:58 -07:00
Wez Furlong e7b8374c3f thread original umask through when spawning mux server
refs: #1633
2022-02-11 10:00:09 -07:00
Wez Furlong cf518c9186 fun with sticky bits and RUNTIME_DIR
This commit does two related things, from opposite ends of the spectrum:

* Sets the sticky bit on pid files and unix sockets to avoid tmpwatch
  deleting them in cleanup scenarios
* Falls back to looking at the changed time if the filesystem doesn't
  support reporting creation time when wezterm does its own liveness
  and cleanup checks for unix domain sockets in the runtime dir
* Allow any wezterm instance to perform that cleanup

refs: #1601
2022-01-31 07:29:15 -07:00
Wez Furlong 6d288696c8 Add SwitchToWorkspace keyassignment action
This action causes the active workspace for the gui to change.

If the name is omitted a random name will be generated.
If the workspace doesn't exist, it will be be created.
The optional spawn parameter can be used to launch a specific
program into the new workspace; if omitted, the default prog
will be used.

The gui only supports a single active workspace. Switching workspaces
will repurpose existing gui windows and re-assign them to windows
in the new workspace, adjusting their size to fit those windows,
spawning new windows or closing unused windows as required.

The gui now exits when there are no panes in the active workspace,
rather than no panes at all.

refs: #1531
2022-01-15 13:53:34 -07:00
Wez Furlong 955b37ff64 mux server: redirect stdout,stderr to log file on Windows
This got lost somewhere along the way.

Importantly, we need to explicitly set the pty to use invalid stdio
handles for the spawned child in order to avoid a weird situation
where eg: cmd or powershell would end up writing to the log file
despite it being spawned into its own PTY.

refs: #1358
2021-12-05 10:11:43 -08:00
Wez Furlong 3b12aa1038 mux: mux_env_remove config to control which env var are removed
closes: #1225
2021-10-17 12:46:16 -07:00
Wez Furlong fb50014ed5 mux: avoid inheriting wrong pane/socket env
The first problem in #1222 is that the environment in the spawned
mux server has inherited the unix socket path from the GUI that
is the client, rather than the mux server.

That means that `wezterm cli` is operating on the mux namespace
of the client (which is a layered/wrapped view of the mux server),
rather than the mux server.

This fixes `wezterm cli split-pane` in the case where unix domains
are in use together with `connect_automatically = true`, although
there is still a really weird issue with tabs that needs to be
run down.

refs: https://github.com/wez/wezterm/issues/1225 (sort of)
refs: https://github.com/wez/wezterm/issues/1222
2021-10-17 09:44:23 -07:00
Wez Furlong 5cc29d1d8c wezterm-mux-server: keep running after all panes are gone
This has been a commonly requested feature in the past week,
and it's a reasonable one.  The mux server inherited the
close-when-done behavior from when it used to be an alternate
front-end in the same executable as the gui, but it doesn't
need to be that way any more.

We also need to accomodate that case in the client: if the
newly attached domain doesn't result in any panes being imported,
we need to spawn a new command there in order to keep the client
alive.  The pre-existing check for whether the mux was empty had
false positives because the local mux may still reference the
pane from the connection UI, which would finish closing out shortly
after we had decided not to spawn anything, and then the client
would close.

refs: https://github.com/wez/wezterm/issues/631
refs: https://github.com/wez/wezterm/issues/507
2021-04-03 15:00:08 -07:00
Wez Furlong dbd7fc28a5 Raise minimum Rust version to 1.51, de-vendor openssl on unix
Rust 1.51 allows addressesing a long-standing TODO which was that we
shouldn't need to build a vendored copy of openssl on most sensible unix
systems.

We do require a vendored copy on macOS and Windows, but due to the way
that Cargo's feature resolver worked, it wasn't possible for this
requirement to be respected.

Rust 1.51 introduces `resolver="2"` which can deal with this feature
resolution!

https://doc.rust-lang.org/nightly/cargo/reference/features.html#feature-resolver-version-2

The upshot of this is that building wezterm on real unix systems that
are not macos will now link against the system libssl, resulting in both
a shorter compile time and less headaches arising from having a slightly
different openssl used by wezterm than the rest of the system.

cc: @jsgf
2021-03-25 09:43:50 -07:00
Wez Furlong 2d02df5f38 add --config name=value CLI options
`wezterm`, `wezterm-gui` and `wezterm-mux-server` now all support
a new `--config name=value` CLI option that can be specified
multiple times to supply config overrides.

Since there isn't a simple, direct way to update arbitrary fields
of a struct in Rust (there's no runtime reflection), we do this
work in lua.

The config file returns a config table. Before that is mapped
to the Rust Config type, we have a new phase that takes each
of the `--config` values and applies it to the config table.

For example, you can think of configuration as working like this
if wezterm is started as `wezterm --config foo="bar"`:

```lua
config = load_config_file();
config.foo = "bar";
return config;
```

The `--config name=value` option is split into `name` and `value`
parts.  The name part is literally concatenated with `config` in
the generated lua code, so the name MUST be valid in that context.
The `value` portion is literally inserted verbatim as the rvalue in the
assignment.  Not quoting or other processing is done, which means
that you can (and must!) use the same form that you would use in
the config file for the RHS.  Strings must be quoted.  This allows
you to use more complicated expressions on the right hand side,
such as:

```
wezterm --config 'font=wezterm.font("Fira Code")'
```

The overrides stick for the lifetime of the process; even if
you change the config file and reload, then the value specified
by the override will take precedence.

refs: https://github.com/wez/wezterm/issues/469
refs: https://github.com/wez/wezterm/issues/499
2021-02-27 10:53:45 -08:00
Benoit de Chezelles c576b9d534 Add cli option --config-file (#459)
* Add cli option --config-file
* Update cli arg doc & make it conflict with skipping config
* When the config is given explicitly (either using --config-file or via WEZTERM_CONFIG_FILE), failing to load this file will use the default config.
* Otherwise the config file is searched one by one in a few directories.
2021-02-07 08:47:33 -08:00
Wez Furlong a9eaf55747 fixup windows build 2020-12-29 16:59:59 -08:00
Wez Furlong 1c0817b2b2 mux: factor out server bits to helper crate 2020-12-29 15:25:15 -08:00
Wez Furlong c66e8f5c5e use $WEZTERM_LOG to configure log levels ad-hoc
80214319ae broke the use of RUST_LOG to
turn up trace logging.

This commit refactors logger initialization into the env-bootstrap crate
so that it is centralized, and adopts the use of `WEZTERM_LOG` to
override the default logging filters, rather than `RUST_LOG`.
2020-12-23 12:19:19 -08:00
Wez Furlong 80214319ae adjust log levels
Revise logging so that we use info level for things that we want
to always log, and adjust the logger config to always log info
level messages.

That means shifting some warning level logs down lower to debug level so
that they aren't noisy.

closes: https://github.com/wez/wezterm/issues/388
2020-12-20 22:01:06 -08:00
Wez Furlong 91f1cc21fc mux/wezterm: move Renderable into Pane
This makes it easier to overrride/overlay inside the mux when
indicating that we are in tmux mode.

refs: https://github.com/wez/wezterm/issues/336
2020-11-20 09:24:56 -08:00