3982 Commits

Author SHA1 Message Date
Mitchell Hashimoto
98b05ffd09 core: nitpick some var names 2024-05-26 20:49:00 -07:00
Mitchell Hashimoto
9f4d4d3c61 font: treated fonts with mixed color/non-color glyphs as text
Related to #1768 but doesn't fix it properly.

This is a temporary hack to avoid some issues with fonts that have mixed
color/non-color glyphs. If there are mixed presentations and the font
does not have emoji codepoints, then we assume it is text. This fixes
the typical scenarios.

This is not a long term solution. A proper long term solution is to
detect this scenario and on a per-glyph basis handle colorization (or
the lack thereof) correctly. It looks like to do this we'll have to
parse some font tables which is considerably more work so I wanted to do
this first.
2024-05-26 10:17:20 -07:00
Mitchell Hashimoto
e427312282 modify var name 2024-05-26 09:28:16 -07:00
Peter Cardenas
e56acef775 🧹 make strikethrough calculation slightly clearer
followup to https://github.com/mitchellh/ghostty/pull/1796
the sources of the strikethrough calculation are made more explicit
here: the ascent and the subtraction of the leading
2024-05-26 01:44:26 -07:00
Mitchell Hashimoto
bc99082242 font/coretext: adjust strikethrough position for fonts with leading
Fixes #1795

This only affected CoreText. When testing with Freetype the
strikethroughs looked correct for fonts with and without leading
metrics.

This commit adjusts our strikethrough position for fonts that have a
leading metric set to better center it. Previously, we centered the
position _including_ the leading value. The leading value is blank, so
we must center it excluding that value.
2024-05-25 15:20:16 -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
06bcbe868f renderer: kitty image with y offset should stretch image
Fixes #1784

This was just a misunderstanding of the "spec." When both a y offset
into the image is specified and a height, the image should be stretched.
I mistakingly thought that the image should be offset (even with this
misunderstanding there was a data corruption bug).

This resolves the issue and output matches Kitty.
2024-05-22 15:40:31 -04:00
Mitchell Hashimoto
1e60f7186c os: some stylistic changes, comments for stderr logging 2024-05-20 19:11:30 -04:00
Gregory Anders
e710a59a43 os: log stderr from open command 2024-05-19 09:00:53 -05:00
Mitchell Hashimoto
d7c64f57b1 font/shaper: periodically reset LRU in cache to avoid slowdown
See: https://github.com/ziglang/zig/issues/17851

Users were noticing that frame render times got slower over time. I
believe (thanks to community for pointing it out) that this is the
culprit.

This works around this issue by clearing and reinitializing the LRU
after a certain number of evictions. When the Zig issue has a better
resolution (either rehash() as a workaround or a better hash
implementation overall) we can change this.
2024-05-18 10:06:41 -04:00
Jeffrey C. Ollie
7c893881c3 Address review comments
1. Switch to using Wyhash instead of a cryptographic hash.
2. Move global variables to App struct.
2024-05-17 17:13:43 -05:00
Mitchell Hashimoto
bc29076f07 Merge pull request #1765 from jparise/bash-command-option
shell-integration: handle 'bash -c command'
2024-05-17 17:08:44 -04:00
Mitchell Hashimoto
add8c9b2c6 Merge pull request #1761 from qwerasd205/fix-link-highlight
fix(renderer/Metal): dirty track link highlights
2024-05-17 16:47:09 -04:00
Mitchell Hashimoto
6307162e49 small comment changes 2024-05-17 16:46:30 -04:00
ilk
a1a97913d3 refactor(shell-integration:elvish): refactor to improve readability 2024-05-17 18:11:00 +03:00
ilk
597328432c feat(shell-integration): add integration for Elvish
- contains `.elv` file that implements the core of Elvish integration.
- does not contain routines needed for automatic integration.
- stored in `./elvish/lib/...` in preparation for automatic integration:
  Elvish imports `.../elvish/lib/*.elv`.

checklist:
- no confirmation on close where the cursor is at prompt:
  works, only occasionally doesn't, I'm not yet sure when.
- new terminals start in pwd of previously focused terminal: works
- prompts resize correctly: works
- triple-click while holding `ctrl` selects output of a command:
  works (when mouse is over the output)
- cursor at the prompt is turned into a bar: works
- ghostty:`jump_to_prompt` scrolls through prompts: works
- `opt`-click moves cursor at the prompt: works
- `sudo` preserves ghostty terminfo:
   untested - not sure when this is needed exactly, but did not encounter
   any errors after sudo, either
2024-05-16 20:45:14 +03:00
Mitchell Hashimoto
cbcb4b27bc Merge pull request #1766 from jparise/bash-readme
shell-integration: update Bash integration details
2024-05-14 18:22:16 -04:00
Jon Parise
d5414d50ea shell-integration: update Bash integration details 2024-05-14 15:06:05 -07:00
Jon Parise
016c58cfe4 shell-integration: handle 'bash -c command'
When the -c option is present, then commands are read from the first
non-option argument command string. Our simple implementation assumes
that if we see at least the '-c' option, a command string was given, and
the shell is always considered to be non-interactive - even if the '-i'
(interactive) option is also given.
2024-05-14 11:01:49 -07:00
Jon Parise
11f3400e49 shell-integration: suppress shellcheck issues 2024-05-14 06:57:02 -07: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
4d67f660a4 fix(renderer/Metal): dirty track link highlights
Partial fix for link highlight dirty tracking. Some issues remain with
soft-wrapped links (see TODO in code), as well as pressing cmd while
hovering without moving the mouse at all doesn't highlight until you do
move the mouse for some reason.
2024-05-12 18:46:32 -04:00
Jeffrey C. Ollie
a89f817b9e adjust log message 2024-05-11 18:13:00 -05:00
Jeffrey C. Ollie
085c964be7 add strict rate limit 2024-05-11 18:13:00 -05:00
Jeffrey C. Ollie
b4404b691d suppress identical desktop notifications 2024-05-11 18:12:57 -05:00
Jeffrey C. Ollie
aa9813bc79 Add split right & split down menu entries for the GTK apprt.
Inspired by #1752
2024-05-11 11:48:11 -05:00
Mitchell Hashimoto
a11c7ac785 update Dear Imgui to 1.90.6 2024-05-10 10:17:33 -07:00
Mitchell Hashimoto
2783d758a4 Merge pull request #1754 from jparise/bash-preexec
shell-integration: update bash-preexec.sh
2024-05-10 09:44:38 -07:00
Jon Parise
baf5116140 shell-integration: update bash-preexec.sh
This pulls in a fix for `bind -x` bindings unintentionally calling the
preexec hook: https://github.com/rcaloras/bash-preexec/pull/152
2024-05-10 09:39:26 -07:00
Qwerasd
ac5725d582 fix(renderer): rebuild font grid and reset shaper cache on hot reload
When hot reloading config with a new font, shaper cache data needs to be
invalidated and the font grid needs to be rebuilt. This change just
makes that happen on all config reloads since it's a rare action so it's
not a performance concern.
2024-05-10 09:39:07 -07:00
Mitchell Hashimoto
61fd7f7fbf renderer/metal: reset cells when font size changes to avoid blank
Fixes #1743
2024-05-09 09:48:08 -07:00
Mitchell Hashimoto
ae0464cf70 Merge pull request #1741 from qwerasd205/non-integer-point-size
feat(font): Non-integer point sizes
2024-05-08 21:36:48 -07:00
Mitchell Hashimoto
9515d642ee Merge pull request #1739 from NgoHuy/fix-gtk4.14
Add GDK_DEBUG as default environment variable for linux
2024-05-08 21:06:47 -07:00
Mitchell Hashimoto
e81f525101 apprt/gtk: set GDK_DEBUG 2024-05-08 21:04:50 -07:00
Qwerasd
5df0935f82 update font_size to f32 in libghostty 2024-05-09 00:03:40 -04:00
Qwerasd
575a477be5 cast dpi to int again
forgot to change this back when I reverted the dpi from f32 to u16
2024-05-09 00:03:40 -04:00
Qwerasd
9056771509 keep font size in sane range 2024-05-09 00:03:40 -04:00
Qwerasd
d01db9f793 revert dpi type to u16 2024-05-09 00:03:40 -04:00
Qwerasd
fa45c18a6a fix point size type 2024-05-09 00:03:40 -04:00
Qwerasd
a9daba6d6d fix freetype face size calculation 2024-05-09 00:03:40 -04:00
Qwerasd
3156df261f fix a couple test failures 2024-05-09 00:03:40 -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
Mitchell Hashimoto
6dcf567554 font: fix coretext test issues with harfbuzz shaper 2024-05-08 18:33:14 -07:00
Mitchell Hashimoto
435bd32cfd font: SharedGridSet works without font discovery 2024-05-08 18:24:55 -07:00
Mitchell Hashimoto
3c882e364a font: disable CJK unification fallback with freetype rasterizer 2024-05-08 12:18:35 -07:00
Mitchell Hashimoto
1cb70d6e40 font/coretext: force LTR shaping 2024-05-08 10:11:57 -07:00
Severus
245aaa34bf Add upstream's issue 2024-05-09 00:00:14 +07:00
Severus
b33190131f Add GDK_DEBUG as default environment variable for linux
Since gtk 4.14, we need to define driver to run OpenGL as (gtk's issue)[https://gitlab.gnome.org/GNOME/gtk/-/issues/6589]
2024-05-08 23:50:08 +07:00
Mitchell Hashimoto
18e5382909 font/coretext: do not assume capacity on arraylist append
Now that we're padding the cells with blanks if we have shaped ligatures
we don't actually know the exact count based on the CoreText APIs, so we
should just dynamically add.
2024-05-08 08:55:28 -07:00