263 Commits

Author SHA1 Message Date
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
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
ilk
7377ca8917 refactor(shell-integration): refactor to make cases alphabetical
also refactors elvish file to evade unobvious returns
and tries to fix some build errors
2024-05-27 16:15:12 -07:00
ilk
1fa830cc73 feat(shell-integration): add automatic integration for Elvish
Fish automatic integration taken as an example.
Just like fish, Elvish checks `XDG_DATA_DIRS` for its modules.
Thus, Fish integration in zig is reused, and integration in
Elvish now removes `GHOSTTY_FISH_XDG_DIR` environment variable
on launch.
2024-05-27 16:15:01 -07:00
Mitchell Hashimoto
41afb62903 very minor nitpicks 2024-05-25 14:19:23 -07:00
Jan200101
94a7166028 terminal: support using the bright palette for bold text 2024-05-25 16:58:19 +02:00
Mitchell Hashimoto
d7b37a9006 config: default window-vsync to true
Fixes #1409
Fixes macOS 14.4,14.5 kernel panics

As noted in the comment in this diff, I've decided to default this to
true because it fixes a couple _really bad_ issues for macOS users. For
macOS users on 14.4 and 14.5 (latest released as of this commit), this
resolves or at least heavily mitigates a possible kernel panic.

This also fixes #1409 where external displays over certain connections
such as DisplayLink would be unusably slow to render.
2024-05-14 07:19:15 -04:00
Qwerasd
d4a7549222 feat(font): Non-integer point sizes
Allows for high dpi displays to get odd numbered pixel sizes, for
example, 13.5pt @ 2px/pt for 27px font. This implementation performs
all the sizing calculations with f32, rounding to the nearest pixel
size when it comes to rendering. In the future this can be enhanced
by adding fractional scaling to support fractional pixel sizes.
2024-05-09 00:03:40 -04:00
Jon Parise
73b3560e62 shell-integration: automatic bash integration
This change adds automatic bash shell detection and integration.

Unlike our other shell integrations, bash doesn't provide a built-in
mechanism for injecting our ghostty.bash script into the new shell
environment.

Instead, we start bash in POSIX mode and use the ENV environment
variable to load our integration script, and the rest of the bash
startup sequence becomes the responsibility of our script to emulate
(along with disabling POSIX mode).
2024-05-05 13:59:52 -07:00
Mitchell Hashimoto
8fdf6b4b64 renderer: add window-vsync option (defaults to false) 2024-05-05 10:18:15 -07:00
Jack N
346eba3152 sprites: dont thicken via font-thicken, + add cursor thickness adjustment 2024-04-22 20:35:23 -07:00
Mitchell Hashimoto
be0d52a4f2 config: rename "wcswidth" to "legacy" for "grapheme-width-method"
We don't actually use libc wcswidth to determine width and even if we
did some terminals use wcwidth (which behaves differently), some use
the Python wcswidth library (which behaves differently), etc. The
reality is there is no real consistency on "legacy" behavior so by
naming it "legacy" we show that we're doing our best but also gives us
wiggle room to change our behavior in the future.

Functionally nothing changes with this commit.
2024-04-19 09:56:22 -07:00
Mitchell Hashimoto
acf823fe3a config: update docs that fullscreen is incompatible with win-deco
Fixes #1684
2024-04-16 09:13:57 -07:00
Mitchell Hashimoto
21a648748d font: CodepointMap supports clone 2024-04-07 10:54:59 -07:00
Mitchell Hashimoto
b9efd83798 font: SharedGridSet uses DerivedConfig 2024-04-06 10:37:26 -07:00
Mitchell Hashimoto
07a5dd0442 config: FontStyle.clone 2024-04-06 10:28:57 -07:00
Mitchell Hashimoto
efb8146c28 config: RepeatableString.clone should clone all the strings too 2024-04-06 10:20:16 -07:00
Marius Svechla
e34b373426 shell-integration: implement no-title option
This adds a new option to the shell integration feature set, `no-title`.
If this option is set, the shell integration will not automatically
update the window title.
2024-04-03 22:00:42 +02:00
Mitchell Hashimoto
41cffd116a Merge pull request #1484 from jparise/window-title-font
macos: configurable titlebar fonts
2024-03-28 09:49:19 -07:00
Mitchell Hashimoto
caf2742b76 Merge pull request #1584 from mitchellh/paged-terminal
Low-memory terminal state implementation
2024-03-26 20:00:20 -07:00
Jon Parise
baf75dfaaf macos: configurable titlebar fonts
Add support for configurable fonts for window and tab titles. This is
only implemented for macOS (and could be macOS-only if other platforms
aren't able to support this using their windowing toolkits). It plays
nicely with regular and titlebar tabs.
2024-03-26 16:56:39 -07:00