From 21bd4bc75203dd12c373600a052a7989e7d2a28e Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Mon, 8 Jun 2026 13:38:47 +0200 Subject: [PATCH] Fixed process creation flag --- runtime/src/pandoc.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/runtime/src/pandoc.rs b/runtime/src/pandoc.rs index 82270059..b49c0c28 100644 --- a/runtime/src/pandoc.rs +++ b/runtime/src/pandoc.rs @@ -12,6 +12,12 @@ use crate::metadata::META_DATA; static HAS_LOGGED_RID_MISMATCH: OnceLock<()> = OnceLock::new(); static HAS_LOGGED_PANDOC_PATH: OnceLock<()> = OnceLock::new(); +/// Microsoft documents CREATE_NO_WINDOW as a process creation flag with value 0x08000000. +/// It starts console applications without opening a console window: +/// https://learn.microsoft.com/en-us/windows/win32/procthread/process-creation-flags +#[cfg(windows)] +const CREATE_NO_WINDOW: u32 = 0x08000000; + pub struct PandocExecutable { pub executable: String, pub is_local_installation: bool, @@ -99,6 +105,9 @@ impl PandocProcessBuilder { let pandoc_executable = Self::pandoc_executable_path(); let mut command = Command::new(&pandoc_executable.executable); + + #[cfg(windows)] + command.creation_flags(CREATE_NO_WINDOW); command.args(&arguments); PandocPreparedProcess {