wez / wezterm

A GPU-accelerated cross-platform terminal emulator and multiplexer written by @wez and implemented in Rust
https://wezfurlong.org/wezterm/
Other
18.18k stars 813 forks source link

Text resize on W11 (CTRL - CTRL +) resizes the entire window, not only the text, when window is not maximized #6439

Open Kyamel opened 1 week ago

Kyamel commented 1 week ago

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

Windows

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

Windows 11 with GlazeWM setup

WezTerm version

wezterm 20240203-110809-5046fc22

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

Yes, and I updated the version box above to show the version of the nightly that I tried

Describe the bug

Text scaling doesn't work as intended. CTRL + or CTRL - makes the terminal window resize, instead of just changing the terminal font size and re-scaling. My config file ins't rewriting CTRL + or CTRL - functionality (they are the default), and the problem is not my tilling window manager (GlazeWM) related, because others terminals works as expected. Others tested terminals were: cmd, Windows terminal and Alacritty. All are able to scale text correct without resizing the window.

To Reproduce

Open Wezterm on Windows 11 on a floating window and try to resize text. When the window is maximized, the scaling works as expected.

Configuration

local wezterm = require("wezterm")
local config = {}

-- Shell Setup
config.default_prog = { "C:\\Program Files\\PowerShell\\7\\pwsh.exe" }

-- Fonts Fammily
config.font = wezterm.font("JetBrains Mono")
config.font_size = 11.0

-- Refresh Rate
config.max_fps = 60

-- Tabs
config.hide_tab_bar_if_only_one_tab = true

-- Color Scheme
config.color_scheme = "Ubuntu"

-- Dynamic Opacity
local transparent_opacity = 0.8 -- 80%
local opaque_opacity = 1.0 -- 100%
local function toggle_opacity(window)
    local current_opacity = window:effective_config().window_background_opacity or 1.0
    if current_opacity == opaque_opacity then
        window:set_config_overrides({
            window_background_opacity = transparent_opacity,
        })
    else
        window:set_config_overrides({
            window_background_opacity = opaque_opacity,
        })
    end
end

-- Keybidings
config.keys = {
    { key = "UpArrow", mods = "SHIFT", action = wezterm.action.ScrollByLine(-3) },
    { key = "DownArrow", mods = "SHIFT", action = wezterm.action.ScrollByLine(3) },
    { key = "o", mods = "CTRL", action = wezterm.action_callback(toggle_opacity) },
    { key = "0", mods = "CTRL", action = wezterm.action.ResetFontSize },
    -- Split
    { key = "h", mods = "CTRL|SHIFT", action = wezterm.action({ SplitHorizontal = { domain = "CurrentPaneDomain" } }) },
    { key = "v", mods = "CTRL|SHIFT", action = wezterm.action({ SplitVertical = { domain = "CurrentPaneDomain" } }) },
    -- Fechar guia
    { key = "x", mods = "CTRL|SHIFT", action = wezterm.action({ CloseCurrentPane = { confirm = true } }) },
}

return config

Expected Behavior

Text font change of size with the windows staying still.

Logs

Debug Overlay wezterm version: 20240203-110809-5046fc22 x86_64-pc-windows-msvc Window Environment: Windows Lua Version: Lua 5.4 OpenGL: NVIDIA GeForce RTX 3050 Laptop GPU/PCIe/SSE2 4.5.0 NVIDIA 546.30 Enter lua statements or expressions and hit Enter. Press ESC or CTRL-D to exit

Anything else?

No response

bew commented 1 week ago

Yes this is the default behavior of Wezterm, if you don't want this you should set this in your config: https://wezfurlong.org/wezterm/config/lua/config/adjust_window_size_when_changing_font_size.html