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
| local wezterm = require 'wezterm' local act = wezterm.action
local GIT_BASH = 'C:/Program Files/Git/bin/bash.exe' local BG_PIC = 'terminal.png' local WSL_DISTRO = 'Ubuntu' local MSYS2_ROOT = 'C:/msys64/'
local is_windows = wezterm.target_triple:match('windows') local function norm(p) return (p:gsub('\\','/')) end
local config = wezterm.config_builder()
config.color_scheme = 'Tokyo Night' config.window_decorations = 'INTEGRATED_BUTTONS|RESIZE' config.initial_cols = 110 config.initial_rows = 30 config.font_size = 14.0 config.font = wezterm.font_with_fallback { { family = 'JetBrainsMono NF', weight = 'Medium' }, { family = 'HarmonyOS Sans SC', weight = 'Medium' }, } config.window_background_opacity = 0.9 config.window_close_confirmation = 'NeverPrompt' config.background = { { source = { File = norm(BG_PIC) }, hsb = { hue = 1.0, saturation = 1.0, brightness = 0.3 }, }, }
config.launch_menu = is_windows and { { label = 'Git-Bash', args = { norm(GIT_BASH) } }, { label = 'PowerShell', args = { 'powershell.exe' } }, { label = 'CMD', args = { 'cmd.exe' } }, { label = 'WSL ('..WSL_DISTRO..')', args = { 'wsl.exe','-d',WSL_DISTRO } },
{ label = 'MSYS2 MINGW64', args = { MSYS2_ROOT..'msys2_shell.cmd', '-defterm', '-here', '-no-start', '-mingw64' } }, { label = 'MSYS2 MINGW32', args = { MSYS2_ROOT..'msys2_shell.cmd', '-defterm', '-here', '-no-start', '-mingw32' } }, { label = 'MSYS2 UCRT64', args = { MSYS2_ROOT..'msys2_shell.cmd', '-defterm', '-here', '-no-start', '-ucrt64' } }, } or { { label = 'zsh', args = { '/bin/zsh' } }, { label = 'bash', args = { '/bin/bash' } }, }
config.keys = { { key = 'p', mods = 'CTRL', action = act.ShowLauncherArgs{ flags = 'FUZZY|TABS|LAUNCH_MENU_ITEMS' } }, { key = 'F11', mods = 'NONE', action = act.ToggleFullScreen }, { key = '+', mods = 'CTRL|SHIFT', action = act.IncreaseFontSize }, { key = '_', mods = 'CTRL|SHIFT', action = act.DecreaseFontSize }, { key = '0', mods = 'CTRL|SHIFT', action = act.ResetFontSize }, { key = 't', mods = 'CTRL', action = act.ShowLauncher }, { key = 'w', mods = 'CTRL', action = act.CloseCurrentTab{ confirm = false } }, { key = 'UpArrow', mods = 'CTRL|SHIFT', action = act.SplitHorizontal{ domain = 'CurrentPaneDomain' } }, { key = 'DownArrow', mods = 'CTRL|SHIFT', action = act.SplitVertical { domain = 'CurrentPaneDomain' } }, }
config.front_end = 'WebGpu' config.max_fps = 60 config.scrollback_lines = 30000 config.enable_scroll_bar = true
return config
|