This adds a new configuration `grapheme-width-method` to change the
default behavior that Ghostty uses to calculate grapheme width. The
default value is `unicode` which is identical to setting mode 2027.
**IMPORTANT:** This changes the default Ghostty behavior to be fully
grapheme-aware including ZWJs, VS15, VS16. This may cause issues with
some legacy programs and shells.
I've changed my mind that this should become the default because enough
people use emojis now that I've found in the beta program there are more
issues reported about "incorrect emoji width" than any possibly desync
issues. We'll see.
For legacy programs, this can still be set to `grapheme-width-method =
wcswidth`.
CLI args are stored in the configuration `_inputs` field for replaying
on configuration reload. When entering `parseManuallyHook`, we consume
all args, preventing storage for replays. Store the args when parsing
manually to allow replay of configuration.
[xdg-terminal-exec](https://github.com/Vladimir-csp/xdg-terminal-exec)
is a proposal to allow users to define a "default" terminal to use when
launching applications which have `Terminal=true` in their desktop file.
Users can symlink their terminal of choice to `xdg-terminal-exec`, which
is the first option used in the GIO launch options, and is gaining
traction elsewhere.
When launched as `xdg-terminal-exec`, ghostty must parse any args as the
command. Add a special case using the same logic as the '-e' flag to
enable ghostty to be launched in this manner.
Fixes: https://github.com/mitchellh/ghostty/issues/658
Fixes#1052
This implements a `close_all_windows` binding in the core and implements
it for macOS specifically. This will ask for close confirmation if any
surface in any of the windows requires confirmation.
This is bound by default to option+shift+command+w to match Safari. The
binding is generall option+command+w but users may expect this to also
mean "Close All Other Tabs" which is the changed behavior if any tabs
are present in a standard macOS application. So I chose to follow Safari
instead.
This doesn't implement this feature for GTK, that's left as an exercise
for a contributor.
This work is mainly targeted at adding the crosshair for when
ctrl/super+alt is pressed. We also add this for when mouse tracking is
enabled so that we show the crosshair when ctrl/super+alt+shift is
pressed at the same time.
I've also changed the event processing logic here because the amount of
keys we have to process has greatly increased. Instead of processing
each individual event, we now process the modifier state.
Additionally, some refactoring has been done geared at starting to
re-work the mouse for the core surface into a something stateful. My
hope is that we can continue to unravel some of this from the core
surface so that we can process key inputs, motion events, and anything
else relevant as inputs to transitions for shape display, click
behavior, etc.
This commit now also moves the ctrlOrSuper handlers to respective parts
in the Key hierarchy, while also adding additional helpers for other
modifiers.
This adds support for the equalize_splits feature that's already
implemented for macOS.
It's essentially a port of the Swift implementation, using the same
weights-mechanism to equalize split sizes.
This adds support for resizing splits via keybinds to the GTK runtime.
Code is straightforward. I couldn't see a way to do it without keeping
track of the orientation of the splits, but I think that's fine.
This ensures that WM_CLASS is being set on X11, looks like this was
missed in #816 (not 100% sure if it always needs to be set in GDK or if
it's a side effect of us not using g_application_run).
This also adds the "x11-instance-name" config attribute to control the
instance name, which defaults to "ghostty" (or "ghostty-debug" on debug
builds).