Repository navigation
Expand file tree
/
Copy pathwezterm.lua
More file actions
91 lines (81 loc) · 2.68 KB
/
Copy pathwezterm.lua
File metadata and controls
91 lines (81 loc) · 2.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
-- Java Linux Ops Lab — WezTerm config
-- Install: ./scripts/setup-wezterm.sh
-- Docs: https://wezfurlong.org/wezterm/config/files.html
--
-- Features for this course:
-- • Status bar shows current lab step (~/.cache/ops-lab/status)
-- • Large scrollback (theory + command output)
-- • Readable fonts and contrast for colored lab-run output
-- • Splits ready (course also opens a log pane with key "l")
local wezterm = require 'wezterm'
local config = wezterm.config_builder()
-- Appearance
config.color_scheme = 'Tokyo Night'
config.font = wezterm.font_with_fallback({
'JetBrains Mono',
'Menlo',
'SF Mono',
'monospace',
})
config.font_size = 13.0
config.line_height = 1.15
config.window_padding = { left = 10, right = 10, top = 8, bottom = 8 }
config.window_background_opacity = 0.97
config.bold_brightens_ansi_colors = true
-- Comfort for long labs
config.scrollback_lines = 20000
config.enable_scroll_bar = true
config.audible_bell = 'Disabled'
config.adjust_window_size_when_changing_font_size = false
-- Tabs
config.use_fancy_tab_bar = true
config.hide_tab_bar_if_only_one_tab = false
config.tab_max_width = 40
-- Cursor
config.default_blink_rate = 500
config.default_cursor_style = 'BlinkingBar'
-- Keys: splits (course uses `wezterm cli split-pane` for logs)
config.keys = {
{ key = 'd', mods = 'CMD', action = wezterm.action.SplitHorizontal { domain = 'CurrentPaneDomain' } },
{ key = 'd', mods = 'CMD|SHIFT', action = wezterm.action.SplitVertical { domain = 'CurrentPaneDomain' } },
{ key = 'w', mods = 'CMD', action = wezterm.action.CloseCurrentPane { confirm = true } },
{ key = 'Enter', mods = 'CMD', action = wezterm.action.ToggleFullScreen },
-- Clear scrollback visually without killing the shell
{
key = 'k',
mods = 'CMD',
action = wezterm.action.ClearScrollback 'ScrollbackAndViewport',
},
}
-- Right status: lab-run.sh writes ~/.cache/ops-lab/status
local function read_ops_status()
local home = os.getenv('HOME') or ''
local path = home .. '/.cache/ops-lab/status'
local f = io.open(path, 'r')
if not f then
return ''
end
local line = f:read('*l') or ''
f:close()
line = line:gsub('%s+$', '')
if #line > 56 then
line = line:sub(1, 53) .. '...'
end
return line
end
wezterm.on('update-right-status', function(window, pane)
local status = read_ops_status()
if status == '' then
window:set_right_status('')
return
end
window:set_right_status(wezterm.format({
{ Foreground = { Color = '#7aa2f7' } },
{ Text = ' ⚙ ' },
{ Foreground = { Color = '#c0caf5' } },
{ Text = status .. ' ' },
}))
end)
-- Nice default when launching from Dock without cwd
config.default_cwd = os.getenv('HOME')
return config