Skip to content

feat(config): move config dir to ~/.config/termscp on macOS and %USERPROFILE%\.termscp on Windows#432

Merged
veeso merged 2 commits into
mainfrom
feat/431-move-config-dir-on-macos-and-windows
Jun 8, 2026
Merged

feat(config): move config dir to ~/.config/termscp on macOS and %USERPROFILE%\.termscp on Windows#432
veeso merged 2 commits into
mainfrom
feat/431-move-config-dir-on-macos-and-windows

Conversation

@veeso

@veeso veeso commented Jun 8, 2026

Copy link
Copy Markdown
Owner

Summary

Moves the config directory to more convenient, CLI-friendly locations on macOS and Windows, resolved through a single per-platform config_dir() function in src/system/environment.rs.

Platform Old New
macOS ~/Library/Application Support/termscp ~/.config/termscp
Windows %APPDATA%\termscp (Roaming) %USERPROFILE%\.termscp
Linux/other $XDG_CONFIG_HOME/termscp unchanged

Migration

Existing users are migrated automatically on first run: when the new directory is absent and the legacy location (dirs::config_dir()/termscp) exists, the whole config directory (config.toml, bookmarks.toml, .ssh/, ...) is moved (fs::rename) to the new path. No-op on Linux (legacy == new).

Cache dir

Stays platform-native (dirs::cache_dir()/termscp) — behavior unchanged.

Tests

  • New: should_migrate_legacy_config_dir, should_not_migrate_when_new_dir_exists, should_not_migrate_without_legacy_dir.
  • Existing environment tests pass; cargo +nightly fmt and cargo clippy --no-default-features -- -Dwarnings clean.

Closes #431

…PROFILE%\.termscp on Windows

Resolve the config directory through a single per-platform config_dir()
function instead of relying on dirs::config_dir everywhere:

- macOS: ~/.config/termscp (was ~/Library/Application Support/termscp)
- Windows: %USERPROFILE%\.termscp (was roaming %APPDATA%\termscp)
- Linux/other: /termscp (unchanged)

Existing users are migrated automatically on first run: when the new
directory is absent and the legacy location exists, the whole config
directory is moved to the new path. The cache directory stays at the
platform-native location.

Closes #431
@vercel

vercel Bot commented Jun 8, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
termscp Ready Ready Preview, Comment Jun 8, 2026 2:18pm

Request Review

Reflect the new config directory locations (~/.config/termscp on macOS,
%USERPROFILE%\.termscp on Windows) across the English and Chinese docs,
and add a CLAUDE.md note to keep both translations in sync.
@cocogitto-bot

cocogitto-bot Bot commented Jun 8, 2026

Copy link
Copy Markdown

✔️ c276ef1...45b34e5 - Conventional commits check succeeded.

@veeso
veeso merged commit afe7b05 into main Jun 8, 2026
8 checks passed
@veeso
veeso deleted the feat/431-move-config-dir-on-macos-and-windows branch June 8, 2026 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move config dir to ~/.config/termscp on macOS and Windows

1 participant