1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-25 22:33:52 +03:00
wezterm/src
Wez Furlong ab03147bd9 config: we can now read ~/.wezterm.lua
This allows for slightly more fancy configuration in the future, but for
now it is rather simple: your lua script returns a configuration struct
with the same shape as that from the TOML file.

A `wezterm` module is provided to the script that provides some
constants to help understand the environment in which wezterm
is running.

I want to add some helpers that make setting up the fonts feel less
weird (lots of nesting in the data model makes this weird).

The ability to conditionally construct configuration is powerful
and helps to address the broader request in
refs: https://github.com/wez/wezterm/issues/152

An example config looks like this:

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

print(wezterm.config_dir);
print(wezterm.executable_dir);
wezterm.log_error("w00t! running " .. wezterm.version
  .. " on " .. wezterm.target_triple ..  " " .. wezterm.home_dir);

return {
  enable_scroll_bar = true,
  enable_tab_bar = true,
  ratelimit_output_bytes_per_second = 400000,
  scrollback_lines = 350000,
  font_dirs = {".dotfiles/fonts"},

  window_padding = {
    left = 2,
    bottom = 2,
  },

  font = {
    font = {{
      family = "Operator Mono SSm Lig Medium",
    }},
  },

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

  ssh_domains = {
    {
      name = "localhost",
      remote_address = "localhost",
      username = "wez",
    },
  },

  tls_clients = {
    {
      name = "cubetls",
      remote_address = "cube-localdomain:8080",
      bootstrap_via_ssh = "cube-localdomain",
    },
  },

  tls_servers = {
    {
      bind_address = "192.168.1.8:8080",
    },
  },

  hyperlink_rules = {
    {
      regex = "\\b\\w+://(?:[\\w.-]+)\\.[a-z]{2,15}\\S*\\b",
      format = "$0",
    },
  },

  font_rules= {
    {
      italic = true,
      font = {
        font = {{
          family = "Operator Mono SSm Lig Medium Italic",
        }}
      },
    },

    {
      italic = true,
      intensity = "Bold",
      font = {
        font = {{
          family = "Operator Mono SSm Lig Book Italic",
        }}
      },
    },

    {
      intensity = "Bold",
      font = {
        foreground = "tomato",
        font = {{
          family = "Operator Mono SSm Lig Bold",
        }}
      },
    },

    {
      intensity = "Half",
      font = {
        font = {{
          family = "Operator Mono SSm Lig Light",
        }}
      },
    },
  },
}
```
2020-02-26 22:11:23 -08:00
..
config config: we can now read ~/.wezterm.lua 2020-02-26 22:11:23 -08:00
font fix inverted logic when warning about not finding a font in font_dirs 2020-02-14 12:38:04 -08:00
frontend tab overlay: allow selecting tab by number 2020-02-21 08:44:35 -08:00
mux allow setting default values for environment variables 2020-02-09 12:55:04 -08:00
scripting config: we can now read ~/.wezterm.lua 2020-02-26 22:11:23 -08:00
server mux: don't panic the server if the client disconnects 2020-02-23 10:38:46 -08:00
connui.rs connui: accommodate multi-line 2fac prompts 2020-02-02 17:01:31 -08:00
keyassignment.rs Add HideApplication and QuitApplication key assignments 2020-02-14 08:49:15 -08:00
localtab.rs track the full current dir URL for OSC 7 2020-01-14 22:06:13 -08:00
main.rs config: we can now read ~/.wezterm.lua 2020-02-26 22:11:23 -08:00
ratelim.rs switch most of the rest of the mux over to the new model 2020-01-05 14:37:17 -08:00
ssh.rs add some more diagnostics for mux connections 2020-02-02 15:02:30 -08:00
stats.rs there's no such thing as an acquire store... 2020-01-17 09:02:16 -08:00
termwiztermtab.rs respect color scheme for termwiz derived tabs 2020-01-25 17:18:45 -08:00