147 Commits

Author SHA1 Message Date
Mitchell Hashimoto
b7f1eaa145 apprt: action to change conditional state, implement for embedded 2024-11-19 15:36:31 -08:00
Mitchell Hashimoto
712da4288f config: add basic conditional system core logic (no syntax yet)
Note: this doesn't have any syntax the user can use in a configuration
yet. This just implements a core, tested system.
2024-11-19 10:17:03 -08:00
Mitchell Hashimoto
3ee6577154 some tweaks 2024-11-09 11:03:02 -08:00
Nadir Fejzic
4c08688275 refactor: remove unused imports 2024-11-09 12:50:51 +01:00
Nadir Fejzic
83c4d0077b refactor: define FreetypeLoadFlags struct and default in font.face 2024-11-09 12:34:39 +01:00
Nadir Fejzic
c0b24ee60d refactor: make freetype flags void for non-freetype backend
This is an attempt to use `void` as type for Freetype Load Flags when
backend does not use these flags.
2024-11-09 01:39:10 +01: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
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
29de3e80f1 config: yeet usingns 2024-08-16 10:49:37 -07:00
Mitchell Hashimoto
55e8c421b5 config: add window-padding-color 2024-08-03 16:14:14 -07:00
Mitchell Hashimoto
b9efd83798 font: SharedGridSet uses DerivedConfig 2024-04-06 10:37:26 -07:00
Mitchell Hashimoto
33c4c328b6 config: file formatter 2024-01-20 12:43:15 -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
Mitchell Hashimoto
eb46161b5e config: generate vim configs at comptime 2023-12-22 08:19:17 -08:00
Mitchell Hashimoto
7600c761ef fix callback struct ordering, use internal_os.open 2023-12-18 08:00:40 -08:00
Mitchell Hashimoto
5db002cb12 renderer/metal: underline urls 2023-11-29 15:30:21 -08:00
Mitchell Hashimoto
0e2970bdeb config: add string parse, tests 2023-11-24 10:26:55 -08:00
Gregory Anders
06cdbc1a96 config: export ClipboardAccess 2023-11-11 17:25:48 -05:00
Mitchell Hashimoto
18c852d47c config: switch shell-integration-features 2023-11-07 17:05:09 -08:00
Mitchell Hashimoto
f7cc5ccdd6 config: add mouse-shift-capture configuration 2023-10-11 21:38:52 -07:00
Mitchell Hashimoto
24af24a086 terminal: CSI q requires a space intermediate 2023-09-10 22:01:17 -07:00
Mitchell Hashimoto
2820db55be config: add C API ghostty_config_get to read configuration values 2023-09-10 18:45:02 -07:00
Mitchell Hashimoto
b14ba8c022 config: extract into dedicated dir, split into files 2023-09-10 16:17:19 -07:00
Mitchell Hashimoto
d9cfd00e9f Big Cursor State Refactor
This makes a few major changes:

  - cursor style on terminal is single source of stylistic truth
  - cursor style is split between style and style request
  - cursor blinking is handled by the renderer thread
  - cursor style/visibility is no longer stored as persistent state on
    renderers
  - cursor style computation is extracted to be shared by all renderers
  - mode 12 "cursor_blinking" is now source of truth on whether blinking
    is enabled or not
  - CSI q and mode 12 are synced like xterm
2023-09-09 20:19:37 -07:00
Thorsten Ball
cac5b00d94 gtk: add gtk-single-instance setting to allow disabling of it
This is based on our conversation on Discord and adds a setting for GTK
that allows disabling the GTK single-instance mode.

If this is off, it's possible to start multiple applications from the
same release binary.

Tested like this:

```
$ zig build -Dapp-runtime=gtk -Doptimize=ReleaseFast && ./zig-out/bin/ghostty --gtk-single-instance=false

[... starts new application ...]
```

and

```
$ zig build -Dapp-runtime=gtk -Doptimize=ReleaseFast && ./zig-out/bin/ghostty --gtk-single-instance=true
info: ghostty version=0.1.0-main+42a22893
info: runtime=apprt.Runtime.gtk
info: font_backend=font.main.Backend.fontconfig_freetype
info: dependency harfbuzz=8.0.0
info: dependency fontconfig=21400
info: renderer=renderer.OpenGL
info: libxev backend=main.Backend.io_uring
info(os): LANG is not valid according to libc, will use en_US.UTF-8
info: reading configuration file path=/home/mrnugget/.config/ghostty/config
info(config): default shell source=env value=/usr/bin/zsh

(process:49045): GLib-GIO-WARNING **: 13:55:56.116: Your application did not unregister from D-Bus before destruction. Consider using g_application_run().

[exits]
```
2023-09-05 13:59:07 +02:00
Mitchell Hashimoto
2c5271ca82 Merge pull request #397 from mitchellh/mrn/gtk-window-decoration
gtk: allow hiding window decoration in configuration
2023-09-03 12:41:14 -07:00
Thorsten Ball
a1a48eb3f0 gtk: allow hiding window decoration in configuration
This is part of #319 by fixing it for GTK and introducing the
configuration option.

This adds `window-decoration = false` as a possible configuration
option. If set to `false`, then no window decorations are used.
2023-09-03 21:27:21 +02:00
SoraTenshi
6faed268e0 config: clean up cursor style configuration 2023-09-03 07:51:36 -07:00
Mitchell Hashimoto
4570356e57 turn zoom into a toggle rather than an explicit zoom/unzoom 2023-09-02 16:03:51 -07:00
Mitchell Hashimoto
519a97b782 core: add unzoom_split binding 2023-09-02 15:15:12 -07:00
Mitchell Hashimoto
50a1a52ae3 core: add zoom keybinding for splits 2023-09-02 14:52:43 -07:00
Will Pragnell
86122624e0 macos: add visible-menu non-native-fullscreen option 2023-09-01 21:45:45 -07:00
Mitchell Hashimoto
ba883ce39a add ghostty_config_trigger C API to find a trigger for an action 2023-08-30 22:14:44 -07:00
SoraTenshi
ead70eadae Add Caveat information for shell integration 2023-08-28 19:44:01 +02:00
SoraTenshi
fcf1537f82 config: Add option for custom cursor style 2023-08-28 18:20:45 +02:00
Mitchell Hashimoto
906852976b config: new "font-variation" set of configurations to set variable font 2023-08-28 07:25:09 -07:00
Mitchell Hashimoto
14c9279c21 config: add doc comment for cursor-text 2023-08-26 09:39:25 -07:00
Kevin Hovsäter
8b9a11db4b Implement cursor text in addition to color 2023-08-26 15:29:48 +02:00
Mitchell Hashimoto
46ba3189f6 config: image-storage-limit to set maximum image memory per terminal 2023-08-23 16:58:16 -07:00
Mitchell Hashimoto
7ccf86b175 remove imgui and devmode
imgui has been a source of compilation challenges (our fault not theirs)
and devmode hasn't worked in awhile, so drop it.
2023-08-20 08:50:24 -07:00
Mitchell Hashimoto
e92021e0c9 config: repeatablestring must copy values it parses into arena 2023-08-18 18:13:19 -07:00
Mitchell Hashimoto
cbd6a325e9 config: macos-option-as-alt now accepts "left", "right" 2023-08-14 12:50:21 -07:00
Mitchell Hashimoto
2ed6e6a40a config: remove pc style function keys, handled separately now 2023-08-13 14:55:32 -07:00
Mitchell Hashimoto
5e2fa50d0b macos-option-as-alt config, handle alt-prefix for charCallback 2023-08-13 14:55:31 -07:00
Mitchell Hashimoto
5d6086a1b1 "copy-on-select" configuation to disable 2023-08-09 14:44:24 -07:00
Mitchell Hashimoto
2fb8ad8196 linux default keybindings for scroll top, bot, page up, down 2023-08-09 07:40:55 -07:00
Mitchell Hashimoto
a8380e937d scroll top, bot, page up, page down binding actions 2023-08-09 07:24:11 -07:00
Mitchell Hashimoto
7ac61469c9 bind sequences for PC style function keys from xterm
Fixes #256

This makes a whole lot more sequences work, such as `ctrl+left`,
`ctrl+shift+f1`, etc. We were just missing these completely.

This also found an issue where if you split a sequence across two
`write()` syscalls, then `/bin/sh` (I didn't test other shells)
treats it as two literals rather than parsing as a single sequence.
Great.
2023-08-08 16:43:27 -07:00
Kevin Hovsäter
22b8173164 Fix typos 2023-08-08 14:27:34 +02:00
Mitchell Hashimoto
22296b377a Revert "Merge pull request #244 from mitchellh/alt-as-esc"
This reverts commit c139279d479682c17f63d9b57c2d56608d09d16a, reversing
changes made to 4ed21047a734d7c586debe0026e3b6ea90ed1622.

We do want to do this but this broke bindings.
2023-08-07 17:06:40 -07:00