Skip to content

Commit

Permalink
Merge pull request #773 from kcbanner/windows_prototype
Browse files Browse the repository at this point in the history
windows: add support for the glfw backend
  • Loading branch information
mitchellh authored Nov 6, 2023
2 parents e77a7e2 + a7fdc1d commit 044a9af
Show file tree
Hide file tree
Showing 20 changed files with 950 additions and 275 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ jobs:
target: [
aarch64-linux,
x86_64-linux,
# No windows support currently.
# i386-windows,
# x86_64-windows-gnu,

x86-windows-gnu,
x86_64-windows-gnu,
# We don't support cross-compiling to macOS because the macOS build
# requires xcode due to the swift harness.
#aarch64-macos,
Expand Down
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ things, but I've been using it full time since April 2022.
| ------------------ | ------------------------------------------------------------------------ | -------------------------- |
| macOS | [Tip ("Nightly")](https://github.com/mitchellh/ghostty/releases/tag/tip) | MacOS 12+ Universal Binary |
| Linux | [Build from Source](#developing-ghostty) | |
| Windows | n/a | Not supported yet |
| Windows | [Build from Source](#developing-ghostty) | [Notes](#windows-notes) |

### Configuration

Expand Down Expand Up @@ -439,13 +439,30 @@ $ sudo log stream --level debug --predicate 'subsystem=="com.mitchellh.ghostty"'
...
```

### Windows Notes

Windows support is still a [work-in-progress](https://github.com/mitchellh/ghostty/issues/437).
The current status is that a bare bones glfw-based build _works_! The experience
with this build is super minimal: there are no native experiences, only a
single window is supported, no tabs, etc. Therefore, the current status is
simply that the core terminal experience works.

If you want to help with Windows development, please see the
[tracking issue](https://github.com/mitchellh/ghostty/issues/437). We plan
on vastly improving this experience over time.

### Linting

Ghostty's docs and resources (not including Zig code) are linted using [Prettier](https://prettier.io) with out-of-the-box settings. A Prettier CI check will fail builds with improper formatting. Therefore, if you are modifying anything Prettier will lint, you may want to install it locally and run this from the repo root before you commit:
Ghostty's docs and resources (not including Zig code) are linted using
[Prettier](https://prettier.io) with out-of-the-box settings. A Prettier CI
check will fail builds with improper formatting. Therefore, if you are
modifying anything Prettier will lint, you may want to install it locally and
run this from the repo root before you commit:

```
npm install -g prettier
prettier --write .
```

Or simply install one of the many Prettier extensions out there for your editor of choice.
Or simply install one of the many Prettier extensions out there for your
editor of choice.
4 changes: 2 additions & 2 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
.dependencies = .{
// Zig libs
.libxev = .{
.url = "https://github.com/mitchellh/libxev/archive/5ecbc871f3bfa80fb7bf0fa853866cb93b99bc18.tar.gz",
.hash = "1220416854e424601ecc9814afb461a5dc9cf95db5917d82f794594a58ffc723b82c",
.url = "https://github.com/mitchellh/libxev/archive/1b46c2d6f32754a3029d1863275dd0f877163831.tar.gz",
.hash = "12208dc0796bffa6ea9edb60193108e34f835f35fc152e853717aca2b13ba17f3be2",
},
.mach_glfw = .{
.url = "https://github.com/hexops/mach-glfw/archive/16dc95cc7f74ebbbdd848d9a2c3cc4afc5717708.tar.gz",
Expand Down
7 changes: 2 additions & 5 deletions src/App.zig
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,8 @@ pub fn create(

// Find our resources directory once for the app so every launch
// hereafter can use this cached value.
var resources_buf: [std.fs.MAX_PATH_BYTES]u8 = undefined;
const resources_dir = if (try internal_os.resourcesDir(&resources_buf)) |dir|
try alloc.dupe(u8, dir)
else
null;
const resources_dir = try internal_os.resourcesDir(alloc);
errdefer if (resources_dir) |dir| alloc.free(dir);

app.* = .{
.alloc = alloc,
Expand Down
Loading

0 comments on commit 044a9af

Please sign in to comment.