428 Commits

Author SHA1 Message Date
Mitchell Hashimoto
3f1d6eb301 expand explicit error set usage
This continues our work to improve the amount of explicit error sets
we use in the codebase. Explicit error sets make it easier to understand
possible failure scenarios, allow us to use exhaustive matching, create
compiler errors if errors are unexpectedly added or removed, etc.

The goal eventually is 100% coverage but we're not even close yet.
This just moves us a little closer.
2024-10-18 08:10:41 -07:00
Justin Su
203110355d Fix "external affects" typo in documentation 2024-10-17 14:59:20 -04:00
Mitchell Hashimoto
115e14f19f macos: NSProcessInfo-based arg iterator
Fixes #2432

On macOS, processes with an NSApplicationMain entrypoint do not have
access to libc argc/argv. Instead, we must use NSProcessInfo. This
commit introduces an args iterator that uses NSProcessInfo, giving us
access to the args.

This also fixes an issue where we were not properly skipping argv0 when
iterating over the args. This happened to be fine because we happened to
ignore invalid args but it introduces a config error.
2024-10-14 17:08:33 -07:00
Mitchell Hashimoto
c26d1cb28e config: add accidentally removed keybinding 2024-10-10 16:47:35 -07:00
Mitchell Hashimoto
ed2cd6d436 macos: remove the ability to bind fn/globe
This was recently introduced a few days ago. Unfortunately, this doesn't
work as expected. The "function" modifier is not actually the fn key
but used by macOS to represent a variety of "functional" key presses.
This breaks other bindings such as #2411.

I can't find a source on the internet that reliably tells me how we
can detect fn key presses, but I do find a number of sources that tell
us we can't.
2024-10-07 14:36:12 -10:00
Mitchell Hashimoto
b9fa6b1b83 config: more caveats for fn 2024-10-05 10:11:25 -10:00
Mitchell Hashimoto
6fdfa9d491 Make the function/globe key available as a modifier on macOS 2024-10-05 09:39:55 -10:00
Mitchell Hashimoto
a278022e5d Bind ctrl+tab and ctrl+shift+tab by default
This matches default behaviors on native apps for macOS and GTK so we
should always bind it.
2024-10-05 09:34:46 -07:00
Lucy Davinhart
a109b8d755 Implements initial-window=false for macOS
Closes https://github.com/ghostty-org/ghostty/issues/2361
2024-10-03 19:09:37 +01:00
Mitchell Hashimoto
66f2d75ddd Change copy-on-select behavior to be more idiomatic for Linux
Fixes #2345

The new docs for `copy-on-select`:

Whether to automatically copy selected text to the clipboard. `true`
will prefer to copy to the selection clipboard if supported by the
OS, otherwise it will copy to the system clipboard.

The value `clipboard` will always copy text to the system clipboard
(for supported systems) as well as the system clipboard. This is sometimes
a preferred behavior on Linux.

Middle-click paste will always use the selection clipboard on Linux
and the system clipboard on macOS. Middle-click paste is always enabled
even if this is `false`.

The default value is true on Linux and false on macOS. macOS copy on
select behavior is not typical for applications so it is disabled by
default. On Linux, this is a standard behavior so it is enabled by
default.
2024-10-01 20:38:27 -07:00
Mitchell Hashimoto
22b9f24978 macos: clarify comments, clean up notifications for fullscreen 2024-09-30 20:10:23 -07:00
Mitchell Hashimoto
045ecacd8c macos: fullscreen mode can be changed at runtime 2024-09-30 10:31:11 -07:00
Mitchell Hashimoto
4f9d49b380 macos: handle multiple monitors properly 2024-09-28 20:52:22 -07:00
Mitchell Hashimoto
1f3c3dde10 input: note fullscreen isn't supported by quick terminal 2024-09-28 18:51:47 -07:00
Mitchell Hashimoto
11d5ec7dc1 config: support quick terminal position 2024-09-28 18:42:25 -07:00
Mitchell Hashimoto
bea24f7725 config: clarify docs 2024-09-24 16:41:29 -07:00
Mitchell Hashimoto
070cc22172 input: global/all bindings can't be sequenced 2024-09-23 14:23:35 -07:00
Mitchell Hashimoto
66143a33ef input: move flags to a packed struct 2024-09-23 14:03:53 -07:00
Mitchell Hashimoto
0394c8e2df input: parse global keys, document them 2024-09-23 10:08:35 -07:00
Mitchell Hashimoto
3769c83bdf config: note that mouse hide while typing on macos requires 15+ 2024-09-21 10:03:57 -07:00
Mitchell Hashimoto
c6bbdfb7bf macos: remove EventSinkHostingView
This was breaking various other features:

  - Popovers stopped working
  - Split divider drag gestures stopped working

For now we document the top part of the window is draggable... we
can look into removing that limitation later.
2024-09-20 22:01:01 -07:00
Qwerasd
ae46ff6854 mention macos-titlebar-style = hidden in window-decoration docs 2024-09-20 16:18:42 -06:00
Qwerasd
16919488da macOS: add macos-titlebar-style = hidden
Hides titlebar without removing the other typical window frame elements
2024-09-20 16:11:51 -06:00
Mitchell Hashimoto
df5cd719d6 macos: rename overlay config to indication 2024-09-19 20:00:46 -07:00
Mitchell Hashimoto
a513a02328 config: config to disable auto secure input and secure input overlay 2024-09-19 17:20:54 -07:00
Mitchell Hashimoto
9c897e29a4 config: return OOM instead of NoSpaceLeft for Linux fmt 2024-09-18 07:35:40 -07:00
Gregory Anders
64abbd0ea6 config: move optional path parsing into RepeatablePath
This commit refactors RepeatablePath to contain a list of tagged unions
containing "optional" and "required" variants. Both variants have a null
terminated file path as their payload, but the tag dictates whether the
path must exist or not. This implemenation is used to force consumers to
handle the optional vs. required distinction.

This also moves the parsing of optional file paths into RepeatablePath's
parseCLI function. This allows the code to be better unit tested. Since
RepeatablePath no longer contains a simple list of RepeatableStrings,
many other of its methods needed to be reimplemented as well.

Because all of this functionality is built into the RepeatablePath type,
other config options which also use RepeatablePath gain the ability to
specify optional paths as well. Right now this is only the
"custom-shaders" option. The code paths in the renderer to load shader
files has been updated accordingly.

In the original optional config file parsing, the leading ? character
was removed when paths were expanded. Thus, when config files were
actually loaded recursively, they appeared to be regular (required)
config files and an error occurred if the file did not exist. **This
issue was not found during testing because the presence of the
"theme" option masks the error**. I am not sure why the presence of
"theme" does this, I did not dig into that.

Now because the "optional" or "required" state of each path is tracked
in the enum tag the "optional" status of the path is preserved after
being expanded to an absolute path.

Finally, this commit fixes a bug where missing "config-file" files were
not included in the +show-config command (i.e. if a user had
`config-file = foo.conf` and `foo.conf` did not exist, then `ghostty
+show-config` would only display `config-file =`). This bug applied to
`custom-shaders` too, where it has also been fixed.
2024-09-17 22:08:59 -05:00
Mitchell Hashimoto
0ac29783b9 config: fix regression for recursive config-files from 5ff0841ee65 2024-09-17 16:51:32 -07:00
Gregory Anders
21e40e9842 config: interpret leading ? in config-file as an optional file
For example, `config-file = ?config.foo` will not report an error if
`config.foo` does not exist.
2024-09-15 09:47:44 -05:00
Mitchell Hashimoto
a9217bd9da config: "-e" implies quit after last window closed
Fixes #2220
2024-09-13 20:57:54 -07:00
Mitchell Hashimoto
841e12a1eb config: make window-padding-color default to "background"
Unfortunately this is a failed experiment. The idea works in many
scenarios, but there are too many valid cases where it confuses people
or results in a very subjective experience. I'm going to revert this
back to "background" to act like other terminals, but the feature
remains available through config.
2024-09-13 20:51:15 -07:00
Mitchell Hashimoto
9548ae532d Merge pull request #2228 from Pangoraw/window-theme
apprt/gtk: add option to color header bars with theme colors
2024-09-13 10:09:44 -07:00
Mitchell Hashimoto
ddb3700609 config: copy 2024-09-13 10:08:48 -07:00
Paul Berg
d7f6f9999f config: remove note that window-new-tab-position is gtk only 2024-09-13 11:38:39 +02:00
Paul
ac985937cd apprt/gtk: add theme variant in window-theme
this colours the header bar with the config colour.
2024-09-13 10:06:42 +02:00
Mitchell Hashimoto
ff2ec11f8c config: update docs, caps 2024-09-11 12:06:40 -07:00
Paul
fa81445701 adw: add option to choose toolbar style 2024-09-11 12:04:12 -07:00
Mitchell Hashimoto
050602a117 Merge pull request #2051 from Pangoraw/adw_tab_view
gtk: use Adwaita TabView when possible
2024-09-11 10:52:19 -07:00
Paul Berg
7aa6b0008a adw: add support for gtk-tabs-location = bottom
this falls back to top when using either right or left.
2024-09-11 17:23:56 +02:00
Mitchell Hashimoto
359272a5f5 macos: start Sparkle after loading config 2024-09-10 21:54:40 -07:00
hanna
fd9d38481b refactor: attempted autoupdate configuration 2024-09-10 21:40:17 -07:00
Jeffrey C. Ollie
d907cebae9 feat: basic +crash-report cli action
Only lists crash reports right now. Viewing and/or submitting crash
reports to come later.
2024-09-10 20:43:00 -07:00
Mitchell Hashimoto
339a83c89d config: note that emoji font requires explicit override
Fixes #2072
2024-09-03 15:32:44 -07:00
Justin Su
f8f289e8b9 config: document left/right values for macos-option-as-alt 2024-08-27 20:36:29 -04:00
Mitchell Hashimoto
bdcc21942d config: font-synthetic-style to enable/disable synthetic styles
This adds a new configuration "font-synthetic-style" to enable or
disable synthetic styles. This is different from "font-style-*" which
specifies a named style or disables a style completely.

Instead, "font-synthetic-style" will disable only the creation of
synthetic styles in the case a font does not support a given style.
This is useful for users who want to obviously know when a font doesn't
support a given style or a user who wants to explicitly only use the
styles that were designed by the font designer.

The default value is to enable all synthetic styles.
2024-08-26 20:52:34 -07:00
Mitchell Hashimoto
80327402b8 Merge pull request #2120 from edmz/last_tab
macos: jump to last_tab
2024-08-26 20:22:52 -07:00
Mitchell Hashimoto
02c6fb5a8c config: remove the super+0 binding for last_tab 2024-08-26 19:59:20 -07:00
Mitchell Hashimoto
b40b6c3438 config: clarify window-width/height behavior 2024-08-26 10:16:39 -07:00
Mitchell Hashimoto
d22551cd31 font/coretext: support synthetic bold 2024-08-23 20:53:22 -07:00
Mitchell Hashimoto
db36a596fb typos 2024-08-23 20:00:43 -07:00