Repository navigation
envSwitch v0.2.1
v0.2.1 (2026-05-20)
Changed — GUI app name to envSwitch
- GUI app bundle product name changed from lowercase
envswitchto camelCaseenvSwitch. CLI binary name remainsenvswitch. - Version bump: 0.2.0 → 0.2.1.
Added — sanitize_cmd() for service subprocess reliability
- New helper
sanitize_cmd()inproviders/homebrew.rs: clears inherited environment and sets onlyPATH+HOME+LANG=C+LC_ALL=C+LC_CTYPE=C. - Applied to all service subprocesses: MySQL (
mysqldinit + start) and PostgreSQL (initdb+pg_ctl). - Guarantees reliable startup from any context (CLI, GUI, launchd, SSH) — C locale is always available on all Unix systems.
Fixed — PostgreSQL GUI startup
init_data_dirwas callingCommand::new("initdb")without a full path. Now usesfind_binary(install_path, "initdb").start_service: clean stalepostmaster.pidbefore starting, detect already-running PostgreSQL, redirectpg_ctlstdout/stderr to log file, wait 2s and verifypg_ctlexit status, confirm postgres PID is alive, return last 20 log lines on failure.- Set
LC_ALL=Cto fixFATAL: postmaster became multithreaded during startupwhen launched from macOS GUI.
Fixed — GUI page state lost on navigation
- Pages were unmounting on sidebar navigation, losing spinner states, expanded sections, and scroll positions.
- Added
KeepAlivewrapper that keeps all main pages mounted and usesdisplay: nonefor inactive ones, with lazy first-mount viauseRef. - Added
usePageActive(path, fn)hook — each page auto-refreshes data when navigated to (Services, Versions, Status, Logs, Doctor).
Fixed — Services page simultaneous spinners
togglingstate changed fromstring | nulltoSet<string>so multiple services can show spinners concurrently on Start All / Stop All.
Docs
- Added screenshots section to both English and Chinese READMEs.
v0.2.1 (2026-05-20)
变更 — GUI 应用名称改为 envSwitch
- GUI app bundle 的 productName 从小写
envswitch改为 camelCaseenvSwitch。CLI 二进制名仍为envswitch。 - 版本号:0.2.0 → 0.2.1。
新增 — sanitize_cmd() 服务进程环境净化
- 新增
sanitize_cmd()辅助函数(位于providers/homebrew.rs):清空继承的环境变量,只保留PATH+HOME+LANG=C+LC_ALL=C+LC_CTYPE=C。 - 应用到所有服务子进程:MySQL(
mysqld初始化/启动)和 PostgreSQL(initdb/pg_ctl)。 - 保证从任何上下文(终端、GUI、launchd、SSH)都能稳定启动 — C locale 在所有 Unix 系统上始终存在。
修复 — PostgreSQL GUI 启动
init_data_dir改用find_binary(install_path, "initdb")解析完整路径,不再依赖 PATH。start_service:启动前清理残留postmaster.pid、检测已运行实例、将pg_ctl输出重定向到日志、等待 2 秒后验证退出状态、确认 postgres PID 存活、失败时返回最后 20 行日志。- 设置
LC_ALL=C修复从 macOS GUI 启动时的FATAL: postmaster became multithreaded during startup错误。
修复 — GUI 页面导航后状态丢失
- 侧边栏切换时页面组件被卸载,导致转圈状态、展开列表、滚动位置等丢失。
- 新增
KeepAlive组件,保持所有主页面挂载,非活跃页面用display: none隐藏,首次访问懒挂载。 - 新增
usePageActive(path, fn)hook,每个页面在导航到时自动刷新数据(Services、Versions、Status、Logs、Doctor)。
修复 — 服务页面多服务同时转圈
toggling状态从单个字符串改为Set<string>,点击"全部启动/停止"时多个服务可同时显示转圈。
文档
- 英文和中文 README 新增截图章节。
Full Changelog: v0.2.0...v0.2.1
Full Changelog: v0.2.0...v0.2.1