1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-28 01:06:37 +03:00
wezterm/docs/config/lua/window/effective_config.md
Wez Furlong 60be1a98a0 lua: add window::effective_config() method
Expose the current window configuration to lua scripts.

refs: https://github.com/wez/wezterm/issues/469
2021-02-27 12:39:22 -08:00

805 B

window:effective_config()

Since: nightly

Returns a lua table representing the effective configuration for the Window. The table is in the same format as that used to specify the config in the wezterm.lua file, but represents the fully-populated state of the configuration, including any CLI or per-window configuration overrides.

Note: changing the config table will NOT change the effective window config; it is just a copy of that information.

This example will log the configured font size when CTRL-SHIFT-E is pressed:

local wezterm = require'wezterm'

wezterm.on("show-font-size", function(window, pane)
  wezterm.log_error(window:effective_config().font_size);
end)

return {
  keys = {
    {key="E", mods="CTRL", action=wezterm.action{EmitEvent="show-font-size"}},
  },
}