166 Commits

Author SHA1 Message Date
Jeffrey C. Ollie
698954031a Add 'Open Config' menu to the GTK runtime and synchronize config-related keybindings across platforms. 2024-01-04 23:30:22 -06:00
Troels Thomsen
d3a7f9baf5 Resolve path relative to base 2024-01-03 23:27:22 +01:00
Mitchell Hashimoto
a57a32cdb3 config: clarify docs on resetting font-family 2024-01-03 09:43:24 -08:00
Mitchell Hashimoto
8dd8bae0cd config: empty value for RepeatableString resets the list 2024-01-03 09:35:03 -08:00
Mitchell Hashimoto
b4f403f152 font-family settings are repeatable to specify fallback 2024-01-03 09:30:12 -08:00
Mitchell Hashimoto
98237b112f config: RepeatableString is null-terminated now
This makes it easier for these values to interface with C APIs
2024-01-03 09:24:15 -08:00
Mitchell Hashimoto
aef93a5420 config: make abnormal runtime threshold a u32 2023-12-30 21:45:16 -08:00
Jeffrey C. Ollie
4ef8d099a7 Make the abnormal runtime threshold configurable. 2023-12-30 22:52:47 -06:00
Mitchell Hashimoto
3ee842e1b7 config: remove command validation
Abnormal exit detection is more robust, and this validation always had
issues for example we didn't parse shell escapes and so on.
2023-12-30 15:36:13 -08:00
Mitchell Hashimoto
8c5e8c504e config: skip command validation if it has a space
See comment
2023-12-30 14:46:05 -08:00
Mitchell Hashimoto
4ec2f50c1d config: validate that command can be found on the path 2023-12-29 11:22:34 -08:00
Mitchell Hashimoto
7fcd4233cd config: not that cursor-style with shell integration overwrites 2023-12-28 09:17:42 -08:00
Mitchell Hashimoto
8b3094465d config: grapheme-width-method, default to "unicode"
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`.
2023-12-25 14:19:05 -08:00
Mitchell Hashimoto
f615a308e0 config: change window-save-state to default 2023-12-23 18:52:40 -08:00
Mitchell Hashimoto
a5d249eb48 config: if window-save-state is never, never restore state 2023-12-22 22:00:25 -08:00
Mitchell Hashimoto
f0bf0fd888 config: window-save-state 2023-12-22 21:51:06 -08:00
Mitchell Hashimoto
900b127a04 core: cursor click to move can be disabled 2023-12-20 22:12:04 -08:00
Mitchell Hashimoto
cea98d3afa config: handle xdg-terminal-exec detection higher up 2023-12-19 13:10:55 -08:00
Tim Culverhouse
d9e4431800 cli: store manually parsed args for config replays
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.
2023-12-19 09:38:11 -06:00
Tim Culverhouse
1137da9238 cli: add xdg-terminal-exec parsing tests
Add two tests for parsing of xdg-terminal-exec.
2023-12-19 08:41:29 -06:00
Tim Culverhouse
e92f8b28d5 cli: parse args as command when launched as 'xdg-terminal-exec'
[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
2023-12-18 12:54:02 -06:00
Tim Culverhouse
5946bc1a53 cli: invert special case arg parsing logic
Invert special case logic so that we can add additional cases. The
previous logic bailed if we weren't the only special case ('-e').
2023-12-18 12:37:23 -06:00
Mitchell Hashimoto
9c0de96c79 Merge pull request #1116 from clebs/feature/settings-shortcut
macos: Add settings shortcut
2023-12-18 08:08:48 -08:00
Mitchell Hashimoto
7600c761ef fix callback struct ordering, use internal_os.open 2023-12-18 08:00:40 -08:00
Mitchell Hashimoto
97433d3aa1 macos: close all windows
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.
2023-12-17 20:54:57 -08:00
Borja Clemente
646e3c365c Add settings shortcut on MacOS
- Settings shortcut opens the config file in the default editor.

Signed-off-by: Borja Clemente <borja.clemente@gmail.com>
2023-12-17 16:19:22 +01:00
Chris Marchesi
6e8ed4e8b3 Surface: set crosshair, change event processing logic for mouse tracking
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.
2023-12-15 19:23:10 -08:00
Mitchell Hashimoto
e36c5203fa Merge pull request #1102 from mitchellh/macos-login
macOS: use login command, "command" now accepts arguments directly
2023-12-15 10:13:52 -08:00
Mitchell Hashimoto
b19ec39868 config: remove command-arg 2023-12-15 09:59:04 -08:00
Mitchell Hashimoto
9f7e53620b Merge pull request #1070 from mattrobenolt/overlay-color
Configurable unfocused dimming color
2023-12-13 19:10:22 -08:00
Mitchell Hashimoto
220da88a9a config: make unfocused-split-fill default to bg 2023-12-13 19:06:25 -08:00
Mitchell Hashimoto
6b94252da6 config: docs 2023-12-13 18:54:36 -08:00
Mitchell Hashimoto
20dbe9792e Merge pull request #1072 from mitchellh/cell-height
`adjust-cell-height` adjustments
2023-12-12 20:59:48 -08:00
Mitchell Hashimoto
8fc0cdb220 font: cursor size remains original cell height if height adjusted
Fixes #1067
2023-12-12 20:43:11 -08:00
Matt Robenolt
3866e09210 Use packed struct 2023-12-12 17:20:42 -08:00
Matt Robenolt
91937c4ada Apply feedback 2023-12-12 17:14:47 -08:00
Matt Robenolt
8e607f372b Configurable unfocused dimming color 2023-12-12 16:34:41 -08:00
Thorsten Ball
e67fa7abe0 gtk: implement equalize_splits
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.
2023-12-12 19:30:29 +01:00
Mitchell Hashimoto
715782b60f config: keybind = clear clears unmaps all keybinds
Fixes #1033

This introduces `keybind = clear` which will unmap all keybindings set
up to that point (including defaults).
2023-12-10 13:57:14 -08:00
Kai Norman Clasen
b46fd01c4e doc: Update gtk-titlebar documentation
Mention that changes to `gtk-titlebar` only
affects new windows.
2023-12-10 13:35:06 +01:00
Thorsten Ball
40e239bf7a gtk: add support for resizing splits via keybinds
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.
2023-12-06 06:25:34 +01:00
Mitchell Hashimoto
62d69e95a5 config: improve docs for minimum-contrast 2023-12-01 22:09:52 -08:00
Mitchell Hashimoto
7af4009f27 renderer/metal: minimum contrast ratio is configurable 2023-12-01 21:24:38 -08:00
Mitchell Hashimoto
3919530a09 Merge pull request #969 from vancluever/vancluever-fix-x11-window-class
gtk: make sure WM_CLASS is being set on X11
2023-11-30 21:40:53 -08:00
Chris Marchesi
1832401e0e gtk: make sure WM_CLASS is being set on X11
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).
2023-11-30 20:26:12 -08:00
Krzysztof Wolicki
0750698b62 Update to latest master,
update libxev dependency,
change mach_glfw to an updated fork until upstream updates
2023-11-30 21:41:33 +01:00
Mitchell Hashimoto
e6f7fb76a8 config: ability to disable URL matching 2023-11-29 16:50:26 -08:00
Mitchell Hashimoto
be05c3af53 input: add Link 2023-11-29 15:30:22 -08:00
Mitchell Hashimoto
f25a136ea5 cli: +list-themes 2023-11-22 21:50:16 -08:00
Mitchell Hashimoto
84e71c8c1f config: update themes docs 2023-11-22 21:38:05 -08:00