How to center a new window on the screen? #5501
Answered
by
luanbt21
bokettoCode
asked this question in
Q&A
-
What Operating System(s) are you running on?Windows Which Wayland compositor or X11 Window manager(s) are you using?No response WezTerm version20240203-110809-5046fc22 Ask your question!I went through the documentation but couldn't find the answer. I want the new WezTerm window to immediately take on a specified size and be centered on the screen. How can I achieve this? |
Beta Was this translation helpful? Give feedback.
Answered by
luanbt21
Jun 2, 2024
Replies: 1 comment 3 replies
-
you can try it wezterm.on("gui-startup", function(cmd)
local screen = wezterm.gui.screens().main
local ratio = 0.7
local width, height = screen.width * ratio, screen.height * ratio
local tab, pane, window = wezterm.mux.spawn_window(cmd or {
position = { x = (screen.width - width) / 2, y = (screen.height - height) / 2 },
})
-- window:gui_window():maximize()
window:gui_window():set_inner_size(width, height)
end) |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
bokettoCode
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you can try it
author comment