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: hide terminal window when checking system proxy on Windows

t8y2c362fedabec7
diff --git a/crates/dbx-core/src/update.rs b/crates/dbx-core/src/update.rs
index c46a916224..d83895aa4d 100644
--- a/crates/dbx-core/src/update.rs
+++ b/crates/dbx-core/src/update.rs
@@ -82,9 +82,20 @@ fn system_proxy_url_from_platform() -> Option<String> {
#[cfg(target_os = "windows")]
fn system_proxy_url_from_platform() -> Option<String> {
+ use std::os::windows::process::CommandExt;
+
let key = r"HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings";
- let proxy_enable = std::process::Command::new("reg").args(["query", key, "/v", "ProxyEnable"]).output().ok()?;
- let proxy_server = std::process::Command::new("reg").args(["query", key, "/v", "ProxyServer"]).output().ok()?;
+ const CREATE_NO_WINDOW: u32 = 0x08000000;
+ let proxy_enable = std::process::Command::new("reg")
+ .args(["query", key, "/v", "ProxyEnable"])
+ .creation_flags(CREATE_NO_WINDOW)
+ .output()
+ .ok()?;
+ let proxy_server = std::process::Command::new("reg")
+ .args(["query", key, "/v", "ProxyServer"])
+ .creation_flags(CREATE_NO_WINDOW)
+ .output()
+ .ok()?;
if !proxy_enable.status.success() || !proxy_server.status.success() {
return None;
}