Fixes#1514
We previously required all preedit inputs to fit into the small copied
message size. That's true for 99% of all inputs, but if a long pre-edit
input comes in, this may not be true. We should try the small array
fast-path but fall back to heap allocation if we must.
Fixes#1505
I verified this behavior with every other terminal and I've added test
cases for it. We previously had a test case to assert the opposite,
which is incorrect.
Fixes#1500
This overhauls how we do focus management for surfaces to make it more
robust. This DID somehow all work before but was always brittle and was
a sketchy play with SwiftUI/AppKit behavior across macOS versions.
The new approach uses our window controller and terminal delegate
system to disseminate focus information whenever any surface changes
focus. This ensures that only ONE surface ever has focus in libghostty
because the controller ensures it is widely distributed.
Adds an rc file for windows. An rc file is a source file given to the
toolchain that instructs it on what "resources" to embed inside the
executable. You can think of "resources" as files or data that get
embedded into the executable and can be accessed both by the application
at runtime or by the OS. The OS uses resources for things like getting
the icon of the executable or extracting the version of an exe for the
user. Note that exe resources can also be modified without having to
recompile/relink the binary.
Thanks to Squeek502 zig has its own "RC Compiler" so this should still be
buildable on all platforms.
In the RC file I've included some basic info and left in comments for
other info to be populated later. I've also included a manifest file
which starts out by telling windows that our exe will be DPI aware and
to use a slightly more modern look and feel for native controls.
looks like the 16x16 icon is not centered, it's got 2 blank lines on the
left and no blank lines on the right. This centers it so there is 1 blank
line on the left and right.
On Windows, the tmpDir function is currently using a buffer on the stack
to convert the WTF16-encoded environment variable value "TMP" to utf8
and then returns it as a slice...but that stack buffer is no longer valid
when the function returns. This was causing the "image load...temporary
file" test to fail on Windows.
I've updated the function to take an allocator but it only uses
the allocator on Windows. No allocation is needed on other platforms
because they return environment variables that are already utf8 (ascii)
encoded, and the OS pre-allocates all environment variables in the process.
To keep the conditional that determines when allocation is required, I
added the `freeTmpDir` function.