582 Commits

Author SHA1 Message Date
Jeffrey C. Ollie
d243ad6616 add a standard zig formatter to Duration and more testing 2024-08-02 15:43:37 -05:00
Jeffrey C. Ollie
cf515c80d0 fix off-by-one error 2024-08-02 15:43:31 -05:00
Jeffrey C. Ollie
3aa1989620 make Duration units a struct field to reduce duplication and enable table-driven unit tests 2024-08-02 10:47:47 -05:00
Jeffrey C. Ollie
3d6ca14dc6 make quit-after-last-window-closed-delay an optional 2024-08-01 10:51:08 -05:00
Jeffrey C. Ollie
143e503d43 gtk: allow running in the background
This patch fixes #2010 by implementing `quit-after-last-window-closed`
for the GTK apprt. It also adds the ability for the GTK apprt to exit
after a delay once all surfaces have been closed and adds the ability to
start Ghostty without opening an initial window.
2024-08-01 01:25:17 -05:00
Mitchell Hashimoto
8ceff43a31 config: introduce config-default-files to skip loading default files
This is a CLI-only config. This is the first such config. I am only
pointing this out since it is a new pattern for Ghostty.

By specifying `--config-default-files=false`, Ghostty will discard any
configuration set in the default files it loads. This makes running
Ghostty from the CLI easier if you want to "reset" the configuration to
the "factory defaults."
2024-07-31 21:01:33 -07:00
Mitchell Hashimoto
62cc279fc0 Merge pull request #1989 from gpanders/cursor-invert-fg-bg
config: add cursor-invert-fg-bg option
2024-07-31 19:39:27 -07:00
Justin Su
898bffb6e5 Update docs for window-padding-x/y 2024-07-26 16:23:03 -04:00
Gregory Anders
3e4a8644b5 renderer/opengl: implement cursor-invert-fg-bg 2024-07-22 16:23:06 -05:00
Mitchell Hashimoto
6f658704ad Merge pull request #1958 from remi-gelinas/remi-gelinas/config-validation-cli-action
feat: add validate-config action
2024-07-22 09:49:49 -07:00
Mitchell Hashimoto
52ce196068 config: clarify reload font-size behavior
Fixes #1988
2024-07-22 09:43:40 -07:00
Gregory Anders
b09e4e5d63 config: add cursor-invert-fg-bg option
When set, the cursor-invert-fg-bg option uses the inverted foreground
and background colors of the cursor's current cell to color the cursor,
rather than using a fixed color. This option has higher precedence than
the cursor-color and cursor-text options, but has lower precedence than
an OSC 12 command to change the cursor color.
2024-07-22 08:42:30 -05:00
multifred
72c672adb7 Fix multiple deprecated names for zig lib/std 2024-07-22 00:07:17 +02:00
Remi Gelinas
4f182c5578 docs: specify path must be absolute 2024-07-21 11:36:43 -04:00
Remi Gelinas
c6cf13ac89 feat: add absolute path assertion 2024-07-21 10:19:46 -04:00
karei
6fde429728 core: support opening scrollback file in default text editor 2024-07-19 19:56:00 -07:00
Mitchell Hashimoto
72c0f9dd32 adjust selection 2024-07-19 14:20:28 -07:00
Mitchell Hashimoto
72d8af5d0b rename to expand_selection 2024-07-19 14:19:21 -07:00
Cameron Dart
cdeeeb9f88 feat: keybinds for text selection on copy mode 2024-07-19 14:08:52 -07:00
Remi Gelinas
699fce0ee5 docs: add docstrings 2024-07-18 11:03:23 -04:00
Remi Gelinas
368868f712 fix: handle relative paths in CLI 2024-07-17 16:51:16 -04:00
Remi Gelinas
3350e3c848 refactor: move config file loading into loadFile 2024-07-17 15:02:03 -04:00
Mitchell Hashimoto
6ac13034fe config: font-family CLI flags will clear font families set in files
This is a quality of life UX change. font-family is a repeatable
configuration where each subsequent value will be added as a fallback
font.

This introduces a UX gotcha where if a font was set in a config file,
the CLI args (which are loaded later) would _append_ to the font
families. This has never once been the behavior I've wanted. Previously,
you'd have to do `--font-family=""` which is clunky.

This change makes it so that CLI font-family flags will automatically
clear the families set in the configuration file.
2024-07-17 11:59:15 -07:00
Mitchell Hashimoto
306e9f8bb6 config: -e CLI flag automatically implies gtk-single-instance=false
`gtk-single-instance` should already be doing desktop-only detection and
in most cases it does. But there are some cases where it isn't and we
haven't quite tracked it down yet.

In any case, when `-e` is used from the CLI, we definitely do not want
to launch in single instance mode because `-e` is typically used in
scripts or for one-off instances. This forces gtk-single-instance to
false.
2024-07-17 11:17:15 -07:00
Mitchell Hashimoto
2d7baaa7d7 apprt/gtk: toggle_window_decorations keybinding
Fixes #1943
2024-07-15 21:23:52 -07:00
Tim Culverhouse
6c40cd963d gtk: implement unfocused-split opacity and fill
For a long time, us GTK users have been subject to lesser UX by not
knowing which split was focused. Improve the GTK UX by implementing both
unfocused-split-opacity and unfocused-split-fill. This is implemented by
setting the background-color of the notebook stack, and conditionally
applying a new css class "unfocused-split" to the unfocused split.
2024-07-10 12:56:09 -05:00
Mitchell Hashimoto
0acdea646b Merge pull request #1923 from antonk52/docs/window-decoration
docs: warn about `window-decoration` disables tabs functionality
2024-07-09 08:34:34 -07:00
Jon Parise
91b56e2494 config: document true/false for shell-integration-features 2024-07-09 10:52:20 -04:00
Anton Kastritskii
d97910a4e8 docs: fix typo 2024-07-09 10:51:51 +01:00
Okan Esen
9eacf6c27d document unfocused split option only working on macOS 2024-07-06 22:48:53 +02:00
Anton Kastritskii
3f85ad6892 docs: specify that window-decoration disables tabs on macos only 2024-07-06 13:42:24 +01:00
Anton Kastritskii
0d6023f059 docs: warn about window-decoration disables tabs functionality 2024-07-05 23:46:27 +01:00
Mitchell Hashimoto
d946809d6d config: note blank valid value 2024-07-01 09:34:07 -07:00
Anton Kastritskii
af18adb192 docs: add valid values for enum config options
fixes #1899
2024-07-01 15:02:22 +01:00
Codey Oxley
73d3761f65 docs: Convert 'unfocused-split-fill' comments into doc block 2024-06-29 21:27:23 -04:00
Justin Su
4de204659d fix a typo in Config.zig 2024-06-25 19:58:21 -04:00
Mitchell Hashimoto
37eb4082fe config: reorder increase font size so it works on macOS menu
Fixes #1826
2024-06-25 10:10:52 -07:00
Mitchell Hashimoto
50019bc766 minor comment changes 2024-06-18 17:09:29 -04:00
Cameron Dart
fd786219d1 feat: focus-follows-mouse 2024-06-10 13:11:53 -07:00
Mitchell Hashimoto
5092cb55ad Merge pull request #1837 from ghostty-org/titlebar-style
macos: macos-titlebar-style, remove titlebar-tabs option
2024-06-07 13:15:14 -07:00
Mitchell Hashimoto
550a9be241 config: introduce macos-window-shadow 2024-06-07 12:46:14 -07:00
Mitchell Hashimoto
25484d2ccc macos: set background opacity/blur on window controller not surface 2024-06-07 12:31:45 -07:00
Mitchell Hashimoto
4dde7edfab config: macos-titlebar-style, remove titlebar-tabs option
Fixes #1833

This is an attempt to simplify the logic that has organically grown
convoluted over time with regards to how the titlebar and tab bar is
styled.

This field is one unified field that ONLY addresses titlebar and tab bar
styling. It can be one of "native", "transparent", or "tabs". The
"native" field is the new behavior in this commit: it makes the titlebar
and tab bar appearance be absolutely native. We do not color anything
(if we do its a bug).

The "transparent" option is the previous `macos-titlebar-tabs = false`
setting where the titlebar/tab bar is native but colored according to
the window background color.

The "tabs" option is `macos-titlebar-tabs = true`.

The `window-theme = auto` affect on titlebar appearance has been
removed. Now, the titlebar will NEVER be styled with "native" and MAY be
styled with "transparent" and will ALWAYS be styled with "tabs" (since
that's a totally custom look anyways).
2024-06-07 12:12:48 -07:00
Mitchell Hashimoto
be598be6de config: xdg-terminal-exec parsing should ignore the initial "-e" 2024-06-06 14:50:04 -07:00
Mitchell Hashimoto
1093ccecb4 xdg-terminal-exec invocations set title based on command
Fixes #1724

See background in #1724. The general idea is that for Ghostty
invocations via xdg-terminal-exec, we set the initial title to the
command automatically so that window managers can modify the styling.

We only do this for xdg-terminal-exec because that protocol/spec is
specifically for the scenario that the terminal is being used to launch
a command from the desktop environment.
2024-06-06 10:01:32 -07:00
Mitchell Hashimoto
cc6d8bfbfd config: clarify some config 2024-06-05 10:29:01 -07:00
Mitchell Hashimoto
99d567274b config: add cgroup memory limit config 2024-06-05 10:27:53 -07:00
Mitchell Hashimoto
3b41b89c23 apprt/gtk: config to hard fail on cgroup init 2024-06-05 09:47:48 -07:00
Mitchell Hashimoto
ad5d44af10 config: control cgroup isolation 2024-06-05 09:43:57 -07:00
Mitchell Hashimoto
14417d2592 Allow keybinding arbitrary unicode codepoints (#1814)
Fixes #1802 

This allows `keybind` configurations to map to any Unicode codepoint. This enables keybindings for which we don't have a registered keycode or for custom keyboard firmwares that may produce arbitrary text (but the Ghostty support is limited to a single codepoint).

The `keybind` syntax is unchanged. If a bound character doesn't map to a known logical key that Ghostty knows about, we map it to a Unicode codepoint. The unicode codepoint is compared against the _unshifted codepoint_ from the apprt key event. 

Note that this binding is to a single _codepoint_. We don't support arbitrary sequences of characters or multi-code point graphemes for keybindings due to the complexity in memory management that would introduce.

This also provides a good fallback for scenarios where it might make sense to educate Ghostty about a key code or fix a bug in our keyboard input system, but the unicode data is correct. In that scenario, unicode key binds should allow key binds to still work while we investigate the input issues.

Example:

```
shift+ö=text:hello
```

This now works as expected on a US hardware keyboard with the Hungarian keyboard layout.
2024-06-02 10:53:36 -07:00