5188 Commits

Author SHA1 Message Date
Mitchell Hashimoto
7d9e50353b terminal/kitty: add virtual placeholders placements 2024-07-25 21:32:44 -07:00
Mitchell Hashimoto
a5c382633f terminal/kitty: placements support location enum (only pin for now) 2024-07-25 21:32:43 -07:00
Mitchell Hashimoto
d29073d999 terminal/kitty: add graphics diacritics file 2024-07-25 21:32:43 -07:00
Mitchell Hashimoto
b103e31727 terminal: isBetween needs to fall through for matching y on top page
Regressed in 9198adcba3477ab521cf215f1f652813e32e1951

This was causing Kitty image intersection to break.
2024-07-25 21:32:28 -07:00
Qwerasd
f17c072637 renderer/metal: use swap chain for custom shader passes 2024-07-25 21:16:35 -04:00
Edmund Miller
3829cc5def zsh: Generalize shebang
Fails on NixOS
/nix/store/lkqjw3yazk7d3il8a0rp11pvjxdyq281-ghostty-0.1.0/share/ghostty/shell-integration/zsh/ghostty-integration: bad interpreter: /bin/zsh: no such file or directory
2024-07-25 08:56:06 -05:00
Mitchell Hashimoto
902913554b terminal: printing over a cell with the same hyperlink keeps flag
Fixes #1990

This fixes and adds a unit test for an edge case where when printing
over the same cell with the same hyperlink ID, we were unsetting the
cell hyperlink state.

This commit also adds a number of integrity checks to verify hyperlinks
remain in a consistent state.
2024-07-23 16:00:09 -07:00
Mitchell Hashimoto
910ef97080 renderer/metal: zig fmt 2024-07-23 10:02:02 -07:00
Mitchell Hashimoto
3b889438aa terminal: page clone handles case where hyperlink can't dupe
Fixes #1991

To check if a hyperlink from another page is already present in our
page's set, we need to dupe the hyperlink struct. If the hyperlink is
already present in our page, this dupe is a waste and is freed.

In the case where the hyperlink is present AND we don't have enough
memory to dupe the hyperlink to check if its present, we'd previous
simply crash out and fail rendering. Debug builds would crash with
integrity errors.

This commit resolves the issue by falling back to a slow path when our
string allocation table is full and iterating over the hyperlink map to
check one by one if we have the hyperlink. This O(N) is much slower than
allocating (in this case) but N is usually low on top of this case being
rare.

A better solution would probably be to ensure we always have some % of
available space free in our string allocation table. This would result
in some wasteful page reallocs but would speed up the render loop. We
can look into that later.
2024-07-22 17:01:25 -07:00
Mitchell Hashimoto
12f0108673 renderer/metal: fix custom shader animations with display link 2024-07-22 15:32:58 -07:00
Mitchell Hashimoto
d07e954933 Merge pull request #1979 from kareigu/gtk-context-menu
apprt/gtk: implement context menu
2024-07-22 15:20:11 -07:00
Gregory Anders
3e4a8644b5 renderer/opengl: implement cursor-invert-fg-bg 2024-07-22 16:23:06 -05:00
karei
5eb7925446 apprt/gtk: don't dim surface when opening context menu 2024-07-22 21:13:07 +03:00
Mitchell Hashimoto
53e942abae apprt/gtk: some stylistic changes 2024-07-22 10:29:59 -07:00
Mitchell Hashimoto
cc3b040571 apprt/gtk: get rid of forcing context menu for now
We have escapes (shift) so lets see how that goes and compare to some
other GTK apps first.
2024-07-22 10:21:18 -07:00
Mitchell Hashimoto
ba2032c1f6 Merge branch 'bash-prompt-marks' 2024-07-22 10:15:37 -07: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
b3e1b2e02a some tweaks 2024-07-22 09:48:23 -07:00
Mitchell Hashimoto
52ce196068 config: clarify reload font-size behavior
Fixes #1988
2024-07-22 09:43:40 -07:00
Mitchell Hashimoto
a75ee29f2d Merge pull request #1981 from injust/adjust-line
Add `adjust_selection` actions for `beginning_of_line` and `end_of_line`
2024-07-22 09:40:45 -07:00
Mitchell Hashimoto
d912c144f2 Merge pull request #1987 from rockorager/main
inspector: fix mode prefix by prepending '?' only to private modes
2024-07-22 09:31:13 -07:00
Jon Parise
aa47047a6e bash: ghostty doesn't support OSC 133;P
Remove OSC 133;P marks in the basic prompts, and use OSC 133;A in the
multiline case.
2024-07-22 10:53:50 -04: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
Tim Culverhouse
8211e7e83a inspector: fix mode prefix by prepending '?' only to private modes
The inspector lists modes by their parameter when used to enable or
disable the mode. Private modes are enabled by using a '?' in the
sequence - however this '?' character was prepended to the ANSI modes.
2024-07-22 05:59:07 -05:00
Justin Su
64f9327a7d Add unit tests 2024-07-21 23:24:11 -04:00
multifred
72c672adb7 Fix multiple deprecated names for zig lib/std 2024-07-22 00:07:17 +02:00
Justin Su
a917d80a1d Merge branch 'ghostty-org:main' into adjust-line 2024-07-21 17:52:46 -04:00
Mitchell Hashimoto
4b5ad77b70 font: fontconfig always prefer monospace in pattern
Fixes #1984
2024-07-21 09:48:07 -07: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
6e5bc62726 apprt/gtk: disable copy in context menu while without selection
Left a FIXME where the "Copy" button action is disabled.

Though very hackish this was the best way I found to do this currently.
Disable sensitivity on the button didn't do anything and trying to
remove the button altogether like on macOS, causes the menu to become
really buggy. Either by the context menu turning into a scrollable list
or by it becoming really janky and showing the user pre-update UI.
2024-07-21 11:10:26 +03:00
karei
57db35036e apprt/gtk: implement context menu
Implements context menu for GTK with:
- copy
- paste
- split right
- split down
- terminal inspector
2024-07-21 11:10:21 +03:00
Justin Su
97bd46de7f Add adjust_selection actions for beginning_of_line and end_of_line 2024-07-20 23:06:47 -04:00
Justin Su
3ad478044b Fix some words 2024-07-20 23:04:24 -04:00
Mitchell Hashimoto
9198adcba3 terminal: Pin.isBetween broken logic
Two bugs:

1. If our pin is the top page, and self.y == top.y, then x will tell us
   the answer. Before, we'd fall through.

2. If our pin is not the top or bottom, but the top == bottom, then we
   can't possibly be between. Before, we'd incorrectly check the linked
   list starting AFTER top.
2024-07-20 14:50:31 -07:00
Mitchell Hashimoto
a62b76eda3 core: add binding to write screen to file 2024-07-19 20:24:51 -07:00
Mitchell Hashimoto
55657465a7 add write_selection_file
Based on the work by @gigamaax
2024-07-19 20:20:49 -07:00
Mitchell Hashimoto
10198d88dc core: make the write scrollback file logic more generic 2024-07-19 20:16:17 -07:00
Mitchell Hashimoto
e3df08039a some bikeshedding 2024-07-19 20:03:20 -07:00
Mitchell Hashimoto
fa264ca160 Revert "apprt/gtk: add menu button for opening scrollback file"
This reverts commit 44dda62d68620937aa6de01ff0097df0b4ff9696.
2024-07-19 19:56:01 -07:00
karei
4e9639711c apprt/gtk: add menu button for opening scrollback file 2024-07-19 19:56:01 -07: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
Jon Parise
2bf1f80f77 bash: add primary and secondary marks to PS1 and PS2
These OSC 133 semantic prompt sequences mark the primary and secondary
parts of the prompt strings.

PS1 is marked as the primary (initial) prompt. This is the default, so
we could skip emitting these sequences, but they're added here for now
to be explicit and consistent with what other terminal emulators do in
their shell integrations.

If PS1 is a multiline prompt (i.e. it contains a newline), we mark the
last line as a secondary prompt (k=s). bash doesn't redraw the leading
lines of a multiline prompt on its own, so we can use this information
at runtime to prevent the preceding lines from being erased by ghostty
after a resize.

PS2 is always marked as a secondary prompt.
2024-07-19 07:44:41 -04:00
Mitchell Hashimoto
1eb18895bf Merge pull request #1964 from jparise/osc-133-secondary
terminal: differentiate OSC 133 continuation and secondary kinds
2024-07-18 21:39:23 -07:00
Mitchell Hashimoto
53d59eb93d Merge pull request #1971 from hauleth/fix/append-to-manpath-instead-of-overriding
fix: instead of overriding MANPATHs set by OS, append to them
2024-07-18 18:53:56 -07:00
Mitchell Hashimoto
f4c26dfaf5 shaper/coretext: use pointer address for cache comparison 2024-07-18 18:46:09 -07:00
Mitchell Hashimoto
1100145cf3 tweaks 2024-07-18 15:57:55 -07:00