Skip to content

How to center a new window on the screen? #5501

Answered by luanbt21
bokettoCode asked this question in Q&A
Discussion options

You must be logged in to vote

you can try it
author comment

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)

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@JaviD17
Comment options

@rafaeloledo
Comment options

@jirpok
Comment options

Answer selected by bokettoCode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants