428 Commits

Author SHA1 Message Date
Atanas Pepechkov
ee1366a0a8 add sudo wrapper as optional shell integration feature 2024-01-13 18:56:21 +02:00
Mitchell Hashimoto
81b9a6b623 config: rename window-append-new-tab to window-new-tab-position 2024-01-12 09:50:47 -08:00
Thorsten Ball
2aa1874f94 gtk: append new tabs at the end if config is set
This adds a new config option: `window-append-new-tabs` (please: if you
have a better name, let me know). If this is set to true, then new GTK
tabs aren't added after the current tab, but after at the end.
2024-01-12 17:35:15 +01:00
Mitchell Hashimoto
5216b4cfe9 build: remove generate_rgb_names 2024-01-10 20:40:21 -08:00
Jeffrey C. Ollie
bc1544a3f0 add ability to specify RGB colors as names from the X11 rgb name list 2024-01-10 20:26:59 -08:00
Mitchell Hashimoto
507a55ba3f Merge pull request #1253 from jcollie/enquiry
implement enquiry/answerback
2024-01-10 09:29:10 -08:00
Mitchell Hashimoto
4b6c2f86a7 termio/exec: remove a bunch of state that is duplicated on StreamHandler
A lot of the state that we put on Exec is just there to copy to
StreamHandler, but we already have it in DerivedConfig. I think this
whole copy copy copy is just legacy cruft since termio.Exec is one of
the older parts of the source code.

This rearchitects the Exec struct to act more like Surface and Renderer
where it stores its derived config. This lets us avoid a few extra
allocations and removes a LOT of struct member noise from termio.Exec.

For pointer lifetimes, the memory allocated is now owned by
DerivedConfig. When changeConfig is called, its the only time BOTH are
still alive, so we can safely swap pointers and deinit without having to
duplicate across threads. This is the same as renderer/surface.
2024-01-10 09:15:55 -08:00
Mitchell Hashimoto
44544f29b2 macos: support Display P3 colorspace through configuration
Fixes #1214

This introduces the `window-colorspace` configuration which allows
configuring the colorspace to use for windows on macOS. The default is
sRGB (same as before) but this can also be set to `display-p3`.
2024-01-09 20:47:07 -08:00
Mitchell Hashimoto
96d33fef20 custom shader animation can be set to "always" to always remain active
Fixes #1225

The `custom-shader-animation` configuration can now be set to "always"
which keeps animation active even if the terminal is unfocused.
2024-01-09 09:21:15 -08:00
Jeffrey C. Ollie
3c2dfd4a84 change name of config entry and variables, add lock for safety during config update 2024-01-09 10:07:32 -06:00
Jeffrey C. Ollie
342b5e9d06 implement enquiry 2024-01-07 23:50:58 -06:00
Mitchell Hashimoto
d65fbba39e config: do not load command from SHELL when launched from desktop
Fixes #139

From the issue:

Looking into this now, I think I figured out the broken logic. When launching
from open, the parent process of Ghostty is launchd which appears to set your
SHELL env var to your configured shell when logging in. That's why a restart
fixes it. However, I believe directory services (the macOS equivalent to
/etc/passwd) is updated in real time.

Ghostty does read directory services but at a lower priority than SHELL.
This logic makes sense for CLI-launched terminals but not desktop-launched.
From a CLI you want the terminal you're launching to probably inherit the shell
from the CLI you launched it from. (Note that using open explicitly forces a
launchd-style launch so it quacks as if it was double-clicked on the desktop).

In conclusion, I believe the correct logic is to invert the priority on SHELL
vs directory services when Ghostty detects it was launched from launchd. We
already have this detection logic in Ghostty because we use it for a number of
other things as well, so this should be easy to fix. I'll work on it later
today.
2024-01-06 12:31:01 -08:00
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