1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-27 15:37:29 +03:00
A GPU-accelerated cross-platform terminal emulator and multiplexer written by @wez and implemented in Rust
Go to file
Wez Furlong ba5d50ba9e add window-resized event
This is to support <https://github.com/wez/wezterm/issues/291>.

The window resized event happens asynchronously wrt. processing
a window resize, triggering at the end of the normal window
resize handling.

This commit introduces the notion of whether we are in full screen
mode or not in the underlying event callback, which is useful to
gate the desired feature, which is: when in full screen mode,
increase the padding for the window to center its content.

While poking around at this, I noticed that we weren't passing
the per-window config down to the code that computes the quad
locations for the window.

This commit also changes the font size increase/decrease behavior
so that in full screen mode it doesn't try to resize the window.

```lua
local wezterm = require 'wezterm';

wezterm.on("window-resized", function(window, pane)
  local window_dims = window:get_dimensions();
  local pane_dims = pane:get_dimensions();
  local overrides = window:get_config_overrides() or {}

  if not window_dims.is_full_screen then
    if not overrides.window_padding then
      -- not changing anything
      return;
    end
    overrides.window_padding = nil;
  else
    -- Use only the middle 33%
    local third = math.floor(window_dims.pixel_width / 3)
    local new_padding = {
      left = third,
      right = third,
      top = 0,
      bottom = 0
    };
    if overrides.window_padding and new_padding.left == overrides.window_padding.left then
      -- padding is same, avoid triggering further changes
      return
    end
    overrides.window_padding = new_padding

  end
  window:set_config_overrides(overrides)
end);

return {
}
```
2021-03-07 11:54:15 -08:00
.cargo build static on windows for static openssl linkage 2020-02-02 13:03:07 -08:00
.github issue template: mention collectin the keyboard layout too 2021-03-02 09:13:41 -08:00
assets Bundle PowerlineExtraSymbols as a fallback font 2021-03-06 19:12:35 -08:00
async_ossl fixup tls mux sessions 2020-10-04 21:47:12 -07:00
base91 dyn everywhere 2019-06-08 21:28:11 -07:00
bintree wezterm: improve pane resize logic 2020-09-27 16:07:08 -07:00
ci docs: migrate misc.md to individual config pages 2021-03-07 00:10:28 -08:00
codec OSC 52: update it so that it we respect primary vs. clipboard selection 2021-02-08 08:56:06 -08:00
config fix typo in battery state value 2021-03-07 00:22:27 -08:00
deps bump freetype dep to VER-2-10-4 2021-01-25 21:35:47 -08:00
docs docs: move this changelog entry to the right place! 2021-03-07 10:12:27 -08:00
env-bootstrap use $WEZTERM_LOG to configure log levels ad-hoc 2020-12-23 12:19:19 -08:00
filedescriptor fix filedescriptor::poll on macos 2020-09-10 13:58:14 -07:00
licenses macOS: bundle and use MetalANGLE to enable Metal rendering 2020-10-17 09:34:01 -07:00
luahelper add window:set_config_overrides lua method 2021-02-27 14:53:19 -08:00
mux mux: introduce can_close_without_prompting concept to model 2021-02-27 09:03:13 -08:00
promise deps: misc updates 2020-12-29 09:24:34 -08:00
pty window: fix ToggleFullScreen on Windows 2021-02-26 19:39:35 -08:00
rangeset deps: misc updates 2020-12-29 09:24:34 -08:00
ratelim move ratelim to its own crate 2020-10-03 11:15:57 -07:00
strip-ansi-escapes move strip-ansi-escapes into its own crate 2020-10-03 11:15:57 -07:00
tabout Change cell api to avoid direct access to hyperlink/image 2020-10-11 13:12:46 -07:00
term adjust some errors -> warnings 2021-03-06 13:58:55 -08:00
termwiz lua: add wezterm.format function 2021-03-02 09:52:54 -08:00
test-data Render custom block glyphs 2021-02-28 09:43:26 -08:00
tmux-cc tmux: attach control mode parser to terminal 2020-11-20 09:24:50 -08:00
umask Take care to restore the original umask 2021-01-07 09:20:13 -08:00
vtparse Use const fn instead of recursive macro 2021-01-22 12:09:07 -08:00
wezterm add --config name=value CLI options 2021-02-27 10:53:45 -08:00
wezterm-client OSC 52: update it so that it we respect primary vs. clipboard selection 2021-02-08 08:56:06 -08:00
wezterm-font Bundle PowerlineExtraSymbols as a fallback font 2021-03-06 19:12:35 -08:00
wezterm-gui add window-resized event 2021-03-07 11:54:15 -08:00
wezterm-gui-subcommands remove --front-end CLI option 2021-02-27 23:59:04 -08:00
wezterm-input-types windows: implement decoration setting, change to bitfield 2021-03-04 09:40:38 -08:00
wezterm-mux-server add --config name=value CLI options 2021-02-27 10:53:45 -08:00
wezterm-mux-server-impl term: plumb Bell through toast notification channel 2021-02-18 22:34:05 -08:00
wezterm-toast-notification toast: avoid blocking the main thread 2021-02-24 09:24:09 -08:00
window add window-resized event 2021-03-07 11:54:15 -08:00
.cirrus.yml ci: refine cirrus skip condition 2021-02-07 09:51:55 -08:00
.gitignore docs: upgrade to mdbook 0.4, enable link checking 2021-01-30 14:14:29 -08:00
.gitmodules repoint to my freetype mirror 2021-02-03 21:56:30 -08:00
.rustfmt.toml Make rustfmt happy about "async move" 2020-01-20 13:58:21 -08:00
Cargo.lock lua: add wezterm.battery_info() function 2021-03-06 14:25:36 -08:00
Cargo.toml cargo update to pick up mlua 5.0.1 and the cross compilation fixes 2021-01-20 20:16:30 -08:00
CONTRIBUTING.md Add get-deps script for installing dependencies 2018-02-25 09:24:56 -08:00
get-deps remove libdbus/libsystem dependency 2021-02-16 22:27:37 -08:00
LICENSE.md wezterm: bundle JetBrains Mono and Noto Color Emoji fonts 2020-09-29 22:05:18 -07:00
README.md update for rename of master branch -> main 2021-02-03 21:34:12 -08:00
wt-record make it a bit easier to consume wt-record 2020-06-12 08:51:15 -07:00
wt-replay update record/play scripts for macos 2019-03-22 20:41:50 -07:00

Wez's Terminal

WezTerm Icon A GPU-accelerated cross-platform terminal emulator and multiplexer written by @wez and implemented in Rust

User facing docs and guide at: https://wezfurlong.org/wezterm/

Screenshot

Screenshot of wezterm on macOS, running vim

Installation

https://wezfurlong.org/wezterm/installation.html

Getting help

This is a spare time project, so please bear with me. There are a couple of channels for support:

The GitHub Discussions and Element/Gitter rooms are better suited to questions than it is to bug reports, but don't be afraid to use whichever you are most comfortable using and we'll work it out.