Skip to main content

WezTerm

WezTerm is a GPU-accelerated terminal emulator that delivers speed and extensive customization through Lua configuration. The main appeal is its true cross-platform support—the same .wezterm.lua config works seamlessly across Windows, Linux, and macOS, providing a consistent terminal experience regardless of your operating system. This makes it ideal for developers working across multiple platforms who want to maintain their workflow and keybindings everywhere.

Wezterm Configuration

On windows, the configuration file is located at:

%USERPROFILE%\\.wezterm.lua
wezterm.lua
-- Pull in the wezterm API
local wezterm = require 'wezterm'
local act = wezterm.action

-- This will hold the configuration.
local config = wezterm.config_builder()

-- This is where you actually apply your config choices.
config.default_domain = 'WSL:Ubuntu'
config.audible_bell = 'Disabled'
config.default_cursor_style = 'BlinkingBar'

-- For example, changing the initial geometry for new windows:
config.initial_cols = 120
config.initial_rows = 28

-- or, changing the font size and color scheme.
config.font_size = 10


-- Custom color scheme with swapped selection colors
local custom_scheme = wezterm.color.get_builtin_schemes()["Sandcastle (base16)"]
local tmp = custom_scheme.selection_fg
-- custom_scheme.selection_fg = custom_scheme.selection_bg
-- custom_scheme.selection_bg = tmp

config.color_schemes = {
["Custom"] = custom_scheme,
}
config.color_scheme = "Custom"

-- Directly set selection instead of swapping bg and fg.
config.colors = {
-- Text colour when selected
selection_fg = 'black', -- or any readable colour
-- Background colour for selection
selection_bg = '#FFD700', -- bright yellow for visibility
}

-- Mouse bindings to paste on right-click
config.mouse_bindings = {
{
event = { Up = { streak = 1, button = 'Right' } },
mods = 'NONE',
action = act.PasteFrom 'Clipboard',
},
}

-- Key binding to paste with CTRL+V
config.keys = {
{
key = 'v',
mods = 'CTRL',
action = wezterm.action.PasteFrom('Clipboard'),
},
}

-- Finally, return the configuration to wezterm:
return config