Skip to content

feat: cross-platform support (Linux and macOS) #8

@relmer

Description

@relmer

Summary

Port TCDir to Linux and macOS, enabling the same colorized directory listing experience across platforms.

Details

Platform Abstractions Needed

  • Console output: Replace Windows Console API (WriteConsoleW) with ANSI escape sequences (already used for color — extend to full output path)
  • File attributes: Map NTFS attributes (RHSDA) to POSIX equivalents (permissions, hidden-by-convention)
  • File enumeration: Replace FindFirstFileW/FindNextFileW with opendir/readdir or platform-native equivalents
  • Cloud status: OneDrive/iCloud detection is Windows-specific — gracefully disable or add platform-specific providers
  • NTFS streams: Windows-only — disable on other platforms
  • File owner: Replace Windows SID lookup with stat() uid/gid resolution
  • Nerd Font detection: Replace GDI-based detection with terminal capability probing
  • Icon mappings: Largely portable (file extension based)
  • Wide string handling: Replace wchar_t/LPCWSTR with UTF-8 throughout

Architecture Considerations

  • TCDir is C++/Win32 — this would be a significant refactor
  • RCDir (Rust) may be a more natural vehicle for cross-platform, but that decision is deferred
  • Could use #ifdef platform gating or a platform abstraction layer
  • Consider whether to maintain a single codebase or fork for platform-specific builds

Build System

  • CMake or Meson for cross-platform builds (replacing MSBuild/vcxproj)
  • CI: add Linux and macOS runners to GitHub Actions

Priority

  • This is a large undertaking — likely a multi-release effort
  • Start with Linux (most demand), then macOS

Prior Art

  • eza: Rust, cross-platform from the start
  • lsd: Rust, cross-platform
  • Both demonstrate that the feature set translates well across platforms

Notes

  • The vehicle for cross-platform (TCDir C++ vs RCDir Rust) is an open question
  • RCDir's Rust codebase with cfg(target_os) gating would be significantly less work
  • This issue is for tracking the idea — actual implementation approach TBD

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions