Skip to content

armgit / dbx

Public Imported from GitHub
0

25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。

fix: suppress terminal popup when checking MCP server status on Windows

t8y2d957734211b1
diff --git a/src-tauri/src/commands/mcp.rs b/src-tauri/src/commands/mcp.rs
index a47df8a0ba..fe9fe41293 100644
--- a/src-tauri/src/commands/mcp.rs
+++ b/src-tauri/src/commands/mcp.rs
@@ -9,6 +9,8 @@ const MCP_PACKAGE_NAME: &str = "@dbx-app/mcp-server";
const MCP_LATEST_URL: &str = "https://registry.npmjs.org/@dbx-app%2fmcp-server/latest";
const MCP_INSTALL_COMMAND: &str = "npm install -g @dbx-app/mcp-server@latest --registry=https://registry.npmjs.org";
const SHELL_COMMAND_MARKER: &str = "__DBX_MCP_COMMAND_OUTPUT_START__";
+#[cfg(windows)]
+const CREATE_NO_WINDOW: u32 = 0x08000000;
#[derive(Debug, Serialize)]
pub struct McpServerStatus {
@@ -171,7 +173,14 @@ fn command_output(command: &str, args: &[&str]) -> Result<CommandOutput, String>
}
fn run_command(command: &str, args: &[&str]) -> Result<CommandOutput, String> {
- let output = Command::new(command).args(args).output().map_err(|e| e.to_string())?;
+ let mut cmd = Command::new(command);
+ cmd.args(args);
+ #[cfg(windows)]
+ {
+ use std::os::windows::process::CommandExt;
+ cmd.creation_flags(CREATE_NO_WINDOW);
+ }
+ let output = cmd.output().map_err(|e| e.to_string())?;
Ok(CommandOutput {
success: output.status.success(),
stdout: String::from_utf8_lossy(&output.stdout).trim().to_string(),