local wezterm = require 'wezterm' local act = wezterm.action local target = wezterm.target_triple local drag_mod = "SUPER" local default_prog = nil -- Windows 特殊处理 if target:find("windows") then drag_mod = "ALT" -- 只在 Windows 使用 PowerShell 7 default_prog = { "C:\\Program Files\\PowerShell\\7\\pwsh.exe", "-NoLogo", "-ExecutionPolicy", "RemoteSigned" } end return { -- 设置底座 default_prog = default_prog, set_environment_variables = { TERM = "xterm-256color", }, keys = { -- 关闭当前 Tab { key = "w", mods = "CTRL|SHIFT", action = wezterm.action.CloseCurrentTab { confirm = true }, }, }, -- Ubuntu + GNOME 更像 iTerm2 window_frame = { font_size = 11, }, -- 像 macOS iTerm2 一样拖动窗口 mouse_bindings = { { event = { Down = { streak = 1, button = "Left" } }, mods = drag_mod, action = act.StartWindowDrag, }, }, -- GPU 渲染 front_end = "WebGpu", -- 字体(非常接近 macOS 观感) font = wezterm.font_with_fallback({ "JetBrains Mono", "Fira Code", "Noto Sans Mono", "JetBrainsMono Nerd Font", }), font_size = 12.5, line_height = 1.15, -- macOS 风格窗口 window_decorations = "RESIZE", window_background_opacity = 0.93, text_background_opacity = 0.93, -- 光标(Sublime 风格) default_cursor_style = "BlinkingBar", cursor_blink_rate = 600, -- 关闭顶部 tab bar(更像 iTerm2) enable_tab_bar = false, -- padding 像 macOS 终端 window_padding = { left = 12, right = 12, top = 10, bottom = 10, }, -- 颜色主题(iTerm2 + Sublime 混合) colors = { foreground = "#E8E8E8", background = "#1E1F22", cursor_bg = "#A6E22E", cursor_fg = "#1E1F22", cursor_border = "#A6E22E", selection_fg = "#FFFFFF", selection_bg = "#44475A", ansi = { "#2D2A2E", "#F92672", "#A6E22E", "#E6DB74", "#66D9EF", "#AE81FF", "#38CCD1", "#F8F8F2", }, brights = { "#75715E", "#FF6188", "#B6E354", "#FFD866", "#78DCE8", "#AB9DF2", "#3BC9DB", "#FFFFFF", }, -- iTerm2 风格 split split = "#44475A", }, -- 滚动条 enable_scroll_bar = false, -- 平滑滚动 scrollback_lines = 5000, -- macOS 动画感 animation_fps = 60, max_fps = 60, }