wezterm icon indicating copy to clipboard operation
wezterm copied to clipboard

Wezterm slow startup time and noticeable resize after window was spawned

Open h3xOo opened this issue 1 year ago • 1 comments

What Operating System(s) are you seeing this problem on?

Linux Wayland

Which Wayland compositor or X11 Window manager(s) are you using?

River

WezTerm version

wezterm 20240922-151228-2b76c63b

Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?

No, and I'll explain why below

Describe the bug

Firstly, when I spawn wezterm, there's noticeable resize happening. Here's log from river

info(wlroots): [wayland] error in client communication (pid 1396)
error(text_input): client requested to enable text input without focus, ignoring request
error(text_input): inactive text input tried to commit an update, client bug?
error(xdg_shell): client with app-id 'org.wezfurlong.wezterm' is buggy and initiated size change while tiled or fullscreen, shame on it
error(text_input): inactive text input tried to commit an update, client bug?

Secondly, there's lag when spawning new instances of wezterm (like ~1/1.5 seconds). Here's comparison between my current terminal emulator (first) and wezterm (second) [and you can see resize happening when spawning wezterm].

https://github.com/user-attachments/assets/eac3bd27-362a-4785-92d5-72c50791c342

I don't know if it's related, but I downgraded mesa and vulkan-mesa-layers to1:24.1.6, because newer versions leak a lot of file descriptors.

To Reproduce

No response

Configuration

-- Pull in the wezterm API
local wezterm = require "wezterm"

-- This table will hold the configuration.
local config = {}

-- In newer versions of wezterm, use the config_builder which will
-- help provide clearer error messages
if wezterm.config_builder then
        config = wezterm.config_builder()
end

config.font = wezterm.font "JetBrainsMono NF"
config.font_size = 13
config.enable_tab_bar = true
config.window_close_confirmation = "NeverPrompt"

config.color_scheme = "Gruvbox dark, soft (base16)"

config.window_padding = {
        left = 4,
        right = 0,
        top = 4,
        bottom = 2,
}

local gpus = wezterm.gui.enumerate_gpus()

config.front_end = "WebGpu"
config.webgpu_preferred_adapter = gpus[2]

config.disable_default_key_bindings = true

config.keys = {
        {
                key = "r",
                mods = "CTRL|SHIFT",
                action = wezterm.action.Search { CaseSensitiveString = "" }
        },
        {
                key = "o",
                mods = "CTRL|SHIFT",
                action = wezterm.action.OpenLinkAtMouseCursor,
        },
        {
                key = "q",
                mods = "CTRL|SHIFT",
                action = wezterm.action.CloseCurrentTab { confirm = false }
        },
        {
                key = "k",
                mods = "CTRL",
                action = wezterm.action.ScrollByPage(-0.5),
        },
        {
                key = "j",
                mods = "CTRL",
                action = wezterm.action.ScrollByPage(0.5),
        },
        {
                key = "k",
                mods = "CTRL|SHIFT",
                action = wezterm.action.ScrollByLine(-1),
        },
        {
                key = "j",
                mods = "CTRL|SHIFT",
                action = wezterm.action.ScrollByLine(1),
        },
        {
                key = "c",
                mods = "CTRL|SHIFT",
                action = wezterm.action.CopyTo "ClipboardAndPrimarySelection",
        },
        {
                key = "v",
                mods = "CTRL|SHIFT",
                action = wezterm.action.PasteFrom "Clipboard",
        },
        {
                key = "p",
                mods = "CTRL",
                action = wezterm.action.ActivateCommandPalette,
        },
        {
                key = "L",
                mods = "CTRL",
                action = wezterm.action.ShowDebugOverlay
        },
}

config.use_fancy_tab_bar = false
config.hide_tab_bar_if_only_one_tab = true
-- config.tab_bar_at_bottom = true
config.tab_max_width = 100

config.default_gui_startup_args = { "start", "--cwd", "." }

wezterm.on("gui-startup", function()
        local tab, pane, window = wezterm.mux.spawn_window {}
        window:gui_window():maximize()
end)

config.hide_mouse_cursor_when_typing = true
config.scrollback_lines = 4096

-- and finally, return the configuration to wezterm
return config

Expected Behavior

No response

Logs

Here's file, since log is pretty big. Ran with

WEZTERM_LOG=debug wezterm >wezterm.log 2>&1

wezterm.log

Anything else?

No response

h3xOo avatar Oct 09 '24 07:10 h3xOo

I also have this issue under Voidlinux running Hyprland

rnb42 avatar Jun 07 '25 19:06 rnb42