From e9da7d31df726dd394874ffd957b866f92901f01 Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Mon, 8 Jun 2026 13:43:41 +0200 Subject: [PATCH] Fixed Windows terminal flash during Pandoc document processing (#799) --- app/MindWork AI Studio/wwwroot/changelog/v26.6.1.md | 1 + runtime/src/pandoc.rs | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/app/MindWork AI Studio/wwwroot/changelog/v26.6.1.md b/app/MindWork AI Studio/wwwroot/changelog/v26.6.1.md index da00a2bb..9742e02f 100644 --- a/app/MindWork AI Studio/wwwroot/changelog/v26.6.1.md +++ b/app/MindWork AI Studio/wwwroot/changelog/v26.6.1.md @@ -10,4 +10,5 @@ - Improved workspaces by allowing new workspaces to be created while moving a chat. - Improved the enterprise configuration details on the information page by showing where each configuration comes from and which configuration slot was used. - Fixed workspace creation and renaming to prevent new workspaces from using an existing name. +- Fixed an issue on Microsoft Windows where reading attached documents could briefly open a terminal window while processing files. - Upgraded dependencies. \ No newline at end of file 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 {