Support Windows

Build a windows-x64 binary and add install.ps1. The editor, browser links, paths, clipboard images and t3tui upgrade all learn Windows' way of doing things; t3tui tmux says it needs WSL.
This commit is contained in:
Callum Alpass committed 2026-11-04 07:56:22 +11:00
1 parent 2845b6fe2b
commit df2c8e0907
23 files changed
+355 -72

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
import { expect, test } from "bun:test";
import { isNvim, windowsCommand, windowsWords } from "../src/ui/editor.ts";
test("splits a Windows command line on spaces outside quotes", () => {
expect(windowsWords('"C:\\Program Files\\Git\\usr\\bin\\vim.exe" -p')).toEqual(["C:\\Program Files\\Git\\usr\\bin\\vim.exe", "-p"]);
expect(windowsWords("code --wait")).toEqual(["code", "--wait"]);
});
test("runs a .cmd through cmd, and anything else as it is", () => {
const which = (program: string) => ({ code: "C:\\VS Code\\bin\\code.cmd", nvim: "C:\\nvim\\nvim.exe" })[program] ?? null;
expect(windowsCommand("code --wait", which)).toEqual(["cmd.exe", "/c", "C:\\VS Code\\bin\\code.cmd", "--wait"]);
expect(windowsCommand("nvim", which)).toEqual(["C:\\nvim\\nvim.exe"]);
expect(windowsCommand("missing", which)).toEqual(["missing"]);
});
test("knows Neovim by name or path", () => {
expect(isNvim("nvim")).toBe(true);
expect(isNvim("/usr/bin/nvim")).toBe(true);
expect(isNvim("C:\\Program Files\\Neovim\\bin\\nvim.exe")).toBe(true);
expect(isNvim("vim")).toBe(false);
});