From 3bf3c748eec38c776dd3c54cbb30be1d44ffb5c3 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Tue, 7 Apr 2026 14:01:18 +0200 Subject: ide: simplify overall configuration --- .nvim.lua | 34 +++++++--------------------------- 1 file changed, 7 insertions(+), 27 deletions(-) (limited to '.nvim.lua') diff --git a/.nvim.lua b/.nvim.lua index 1cec8af..ba8f78b 100644 --- a/.nvim.lua +++ b/.nvim.lua @@ -49,39 +49,19 @@ local function launch_qemu(artifact_path, is_debug) end local paths = resolve_build_paths(artifact_path) + local debug_flag = is_debug and "1" or "0" + local shell_cmd = string.format("%s/scripts/qemu-wrapper.sh '%s' '%s' '%s' '%s'", + workspace_folder, workspace_folder, paths.build_type, paths.iso, debug_flag) - local cmd = { - "qemu-system-x86_64", - "-m", "32M", - "-machine", "q35", - "-smp", "4,sockets=1,cores=4,threads=1", - "-display", "curses", - "-debugcon", string.format("file:%s/qemu-debugcon-%s.log", workspace_folder, paths.build_type), - "-cdrom", paths.iso - } - - if is_debug then - table.insert(cmd, 2, "-s") - table.insert(cmd, 3, "-no-reboot") - table.insert(cmd, 4, "-d") - table.insert(cmd, 5, "int,cpu_reset") - end - - local shell_cmd = string.format("%s 2>%s/qemu-stderr-%s.log", table.concat(cmd, " "), workspace_folder, paths.build_type) - - vim.cmd("botright vsplit") - vim.cmd("enew") + vim.cmd("botright vsplit | enew") qemu_bufnr = vim.api.nvim_get_current_buf() - - vim.api.nvim_buf_set_name(qemu_bufnr, "TeachOS QEMU") + vim.api.nvim_buf_set_name(qemu_bufnr, "TeachOS QEMU (" .. paths.build_type .. ")") vim.opt_local.number = false vim.opt_local.relativenumber = false vim.opt_local.signcolumn = "no" - qemu_job_id = vim.fn.termopen({ "bash", "-c", shell_cmd }, { - on_exit = function() - qemu_job_id = nil - end + qemu_job_id = vim.fn.termopen(shell_cmd, { + on_exit = function() qemu_job_id = nil end }) vim.cmd("wincmd p") -- cgit v1.2.3