Skip to content

envSwitch v0.2.1

Choose a tag to compare

@dacj4n dacj4n released this 20 May 02:46
· 8 commits to main since this release

v0.2.1 (2026-05-20)

Changed — GUI app name to envSwitch

  • GUI app bundle product name changed from lowercase envswitch to camelCase envSwitch. CLI binary name remains envswitch.
  • Version bump: 0.2.0 → 0.2.1.

Added — sanitize_cmd() for service subprocess reliability

  • New helper sanitize_cmd() in providers/homebrew.rs: clears inherited environment and sets only PATH + HOME + LANG=C + LC_ALL=C + LC_CTYPE=C.
  • Applied to all service subprocesses: MySQL (mysqld init + 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_dir was calling Command::new("initdb") without a full path. Now uses find_binary(install_path, "initdb").
  • start_service: clean stale postmaster.pid before starting, detect already-running PostgreSQL, redirect pg_ctl stdout/stderr to log file, wait 2s and verify pg_ctl exit status, confirm postgres PID is alive, return last 20 log lines on failure.
  • Set LC_ALL=C to fix FATAL: postmaster became multithreaded during startup when 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 KeepAlive wrapper that keeps all main pages mounted and uses display: none for inactive ones, with lazy first-mount via useRef.
  • Added usePageActive(path, fn) hook — each page auto-refreshes data when navigated to (Services, Versions, Status, Logs, Doctor).

Fixed — Services page simultaneous spinners

  • toggling state changed from string | null to Set<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 改为 camelCase envSwitch。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