Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #20
main.cpassed&medium_enabled(abool*) toGHOSTTY_TERMINAL_OPT_KITTY_IMAGE_MEDIUM_TEMP_FILE, but that optiontakes a
GhosttyString*(the directory the temp-file medium isrestricted to; NULL disables it).
MEDIUM_FILEandMEDIUM_SHARED_MEMdo take
bool*, so the shared variable hid the mismatch.Debug builds panic at startup with "incorrect alignment" in
ghostty_terminal_set, because the library casts the 1-bytebooltoGhosttyString*. In Release builds the library reads aGhosttyStringfrom a 1-byte object, which is undefined behavior.
This passes a
GhosttyStringfor/tmpto the temp-file option. Thestring is copied into the terminal, so a literal is safe. The
bool*options are unchanged, and comments explain the type difference, per
AGENTS.md. The change is limited to
main.c;CMakeLists.txtandlibghostty are untouched.
Tested:
cmake -B build-dbg -G Ninja -DCMAKE_BUILD_TYPE=Debugthencmake --build build-dbg && ./build-dbg/ghostling(Debug) launcheswith no panic. It panicked at
main.c:1351before this change.Note: We can change
/tmpif you'd prefer$TMPDIRto be a different default.Note: building currently hangs on
bin2header.cmake(#16` fixed in #19 ). I tested on top of that fix.