croft on Windows
Short version: run croft inside WSL2, hosted in a graphics-capable terminal (WezTerm).
- Native Windows (PowerShell /
conhost) is not supported, and is unlikely to be worth supporting, for the reasons below. - For what croft does and the full keyboard surface see the README and KEYBINDINGS.md.
WSL2 works today (it is the Linux build)
croft has no separate "Windows" target. Inside WSL2 you are running real Linux.
- croft's normal
x86_64-unknown-linux-gnubuild compiles and runs unmodified. - Full feature set: PTYs, file watching, language servers, the
Ctrlcommand modifier, andcroft remote <host>. - Everything in LINUX.md applies verbatim.
# inside your WSL2 distro (Ubuntu, Debian, etc.)
cargo install croft-software --locked
What WSL does not change is the terminal. A WSL shell renders into whichever Windows terminal emulator hosts it. That choice decides whether you get the full icon/image UI or the degraded text fallback:
| Host terminal for the WSL shell | Result |
|---|---|
| WezTerm (Windows build, pointed at the WSL shell) | Full UI: activity-bar icons, file icons, the hero image, and PDF / image / spreadsheet previews all render. Recommended. |
| Windows Terminal (the default WSL host) | Runs image-less: icons fall back to Nerd Font glyphs, image and PDF previews to half-block characters under a metadata-header line. |
Legacy conhost console | Same image-less fallback, and a worse Nerd Font / truecolor story. |
- WezTerm implements the iTerm2 OSC-1337 and Kitty graphics protocols croft draws with.
- Under Windows Terminal, croft shows its one-time "switch terminal" nudge on launch.
The practical setup: WSL2 for the OS, WezTerm for the terminal, and a Nerd Font configured in WezTerm. See LINUX.md for the font and dependency notes, which all apply inside WSL.
Why native Windows (PowerShell / conhost) is not supported
Reading "Windows is not supported" as "nobody ported the PTY yet," gets it backwards: the PTY is the least of it. croft uses portable-pty (Cargo.toml), the WezTerm crate that already abstracts Windows ConPTY. Three other layers block a port, in increasing order of difficulty.
1. Direct POSIX syscalls (mechanical, but everywhere)
libc is a hard dependency, and croft calls it directly on several paths. None exist on Windows and none is behind a cfg(windows) branch, so the crate does not even compile for *-pc-windows-msvc today:
src/iterm2_inline.rs—libc::poll/pollfd/POLLINfor the sixel DA1 capability probe (a timed raw read of stdin).src/remote.rs—getrlimit/setrlimitonRLIMIT_NOFILEto raise the open-file limit before spawning PTYs, watchers, LSPs, and the cross-link.src/dap/transport.rs,src/lsp/install.rs—setsid/getsidto detach spawned adapters and servers into their own process group.src/widgets/file_tree.rs—localtime_rfor mtime formatting and theEXDEVcross-device-rename fallback.
Porting these is busywork, not research, but it touches many modules. Each needs a Win32 equivalent behind a cfg(windows) arm: WaitForMultipleObjects / overlapped I/O, SetHandleInformation or job objects, CreateProcess flags, GetDiskFreeSpaceEx, localtime_s.
2. macOS / Linux-only glue
Several integrations are written for the two supported OSes and silently no-op elsewhere:
- Clipboard (
src/clipboard.rs):NSPasteboardon macOS,wl-copy/xclip/xselon Linux. Thecfg(not(any(macos, linux)))arm returns nothing, so copy/paste would be dead on native Windows until a Win32 clipboard backend is added. - Cmd-chord delivery, the drag-out helper, and the
setup-iterm2/setup-ghosttycommands are macOS-and-iTerm2 specific, with no Windows analogue.
3. The graphics model is the real wall, and it is terminal-deep, not OS-deep
This is the decisive one.
- croft's visual identity is painted with the iTerm2 OSC-1337 inline-image protocol and the Kitty graphics protocol, with sixel as a runtime-probed fallback.
- That covers activity-bar icons, file-type icons, the no-repo hero illustration, the editor/welcome background, and every PDF / image / spreadsheet preview.
- croft assumes a terminal speaking at least one of these.
- The stock Windows console stack (
conhost, and the Windows Terminal that fronts PowerShell) implements none of them. - So even with every syscall above ported and the binary running cleanly under PowerShell, you would get the image-less fallback: Nerd Font glyphs for icons, half-block characters for image previews. That is the degraded mode croft already warns about at startup, on any OS.
The real UI on Windows needs a terminal emulator implementing the protocols. In practice that means WezTerm (cross-platform, speaks both).
Once you run WezTerm on Windows, the natural way to give it a POSIX environment is WSL, which puts you back on the supported Linux build.
Hence "WSL2 + WezTerm" over a native port: the port's best case still needs WezTerm, and WSL gets there without rewriting the syscall and clipboard layers.
Summary
- Use croft on Windows via WSL2, hosted in WezTerm, with a Nerd Font configured. This is fully supported as the Linux build.
- Native PowerShell / conhost is not supported and is not on the roadmap:
- It would need Windows branches for every
libccall plus a Win32 clipboard backend. - Even then the stock Windows console cannot render croft's graphics, so the payoff is capped at the image-less fallback unless you run WezTerm anyway.
- It would need Windows branches for every