local wezterm = require("wezterm")

local function start_nvim_with_dir(dir)
	local mux = wezterm.mux
	local project_dir = wezterm.home_dir .. dir

	-- Spawn a new window with Neovim in the specified project directory
	local tab, main_pane, window = mux.spawn_window({
		cwd = project_dir,
		args = { "nvim", project_dir }
	})

	-- Split the main pane downward for the terminal
	local terminal_pane = main_pane:split({
		direction = "Bottom",
		size = 0.3, -- Adjust this value to control the height of the terminal pane
		cwd = project_dir,
	})
	terminal_pane:send_text("ipython\n")
end

return {
	start_nvim_with_dir = start_nvim_with_dir,

	-- Neovim-specific settings
	font = wezterm.font_with_fallback({
		"JetBrains Mono",
		"Noto Color Emoji",
	}),
	font_size = 12.0,
	enable_tab_bar = false,
	window_padding = {
		left = 0,
		right = 0,
		top = 0,
		bottom = 0,
	},
	animation_fps = 30,
	enable_wayland = false, -- Disable Wayland for better performance (if applicable)
}

