7920 Commits

Author SHA1 Message Date
Mitchell Hashimoto
799877a436 Merge pull request #2608 from Pangoraw/toggle_split_zoom
gtk: implement toggle_split_zoom
2024-11-09 09:59:29 -08:00
Mitchell Hashimoto
ca2bf04daa Merge pull request #2639 from eljobe/fix/list-themes
Fix copying the theme name
2024-11-09 09:39:35 -08:00
Pepper Lebeck-Jobe
3c493f2d0d Fix copying the theme name
Prior to this change both C and c would copy the path to the theme even though
the help screen claimed that c would copy the theme name.

There is a bug in libvaxis that results in both of these matches matching c:
  `key.matches('c', .{})`
	`key.matches('c', .{ .shift = true })`

Tested:
  Before the change: 'c' copies path and 'C' copies path
  After the change: 'c' copies the name and 'C' copies the path
2024-11-09 10:10:29 +01:00
Mitchell Hashimoto
75fe0b2dfb Merge pull request #2617 from ghostty-org/pagelist-wip
chore: rename fields in PageList, move data structures to package, move PageList to intrusive linked list
2024-11-07 15:49:08 -08:00
Mitchell Hashimoto
20961e31e2 Merge pull request #2616 from reykjalin/fix-hostname-validation-for-sub-10-ports
Fix hostname as mac address handling when last section starts with '0'
2024-11-07 15:31:28 -08:00
Kristófer R
84707932d2 os/hostname: fix mac address handling when last section starts with '0'
I hit an edge case when using Private Wi-Fi addressing on macOS where
the last section of the randomized mac address starts with a '0'. The
hostname parsing for the shell integration didn't handle this case, so
issue #2512 reappeared.

This fixes that by explicitly handling port numbers < 10.
2024-11-07 18:17:51 -05:00
Mitchell Hashimoto
1335af3e4a terminal: change pagelist linked list to an intrusive linked list 2024-11-07 15:12:54 -08:00
Mitchell Hashimoto
3aff43b2e8 datastruct: add intrusive doubly linked list 2024-11-07 14:57:55 -08:00
Mitchell Hashimoto
a436bd0af6 move datastructures to dedicated "datastruct" package 2024-11-07 14:39:10 -08:00
Mitchell Hashimoto
aed51fd0b0 terminal: PageList rename "page" to "node" everywhere
This is more correct: a pagelist is a linked list of nodes, not pages.
The nodes themselves contain pages but we were previously calling the
nodes "pages" which was confusing, especially as I plan some future
changes to the way pages are stored.
2024-11-07 13:44:39 -08:00
Mitchell Hashimoto
7517d0a86b Merge pull request #2613 from qwerasd205/git-drawing-chars
feat(font/sprite): branch drawing characters
2024-11-07 09:56:31 -08:00
Mitchell Hashimoto
712bcfe680 Merge pull request #2612 from phillip-hirsch/feature/Add-bat-syntax-highlighting-to-macOS-package-contents
Feature: Add bat syntax highlighting to macOS app's package contents
2024-11-07 08:52:58 -08:00
phillip-hirsch
a420496e95 feat: Add bat syntax highlighting to macOS package contents 2024-11-06 19:12:58 -05:00
Qwerasd
4dbf404dc3 font/sprite: cleanup branch drawing character impl, implement fade-out lines 2024-11-06 18:44:12 -05:00
Meili C
0441987346 font feature: add git branch characters
addresses #2561 - adds support for most Git branch drawing characters as
specified in ![kitty/7681](https://github.com/kovidgoyal/kitty/pull/7681)
except for fading vertical and horizontal lines.

Adds git_draw_node function and a new Git node type.
Add this range (0xf5d0...0xf60d) for Git branch characters, to tests.
adds vline_middle_xy and hline_middle_xy for node connections.
add git characters to Face.zig.
2024-11-06 18:26:23 -05:00
Mitchell Hashimoto
444cf3b402 Merge pull request #2611 from phillip-hirsch/feature/Add-syntax-highlighting-for-viewing-config-file-with-bat
Feature: Add syntax highlighting for viewing config file with bat
2024-11-06 14:22:21 -08:00
phillip-hirsch
b5ed4cb680 feat: Add syntax highlighting for bat 2024-11-06 17:06:24 -05:00
Mitchell Hashimoto
f5c84dfdf3 Merge pull request #2609 from ghostty-org/push-uuprylpzkqsn
coretext: variable font fixes
2024-11-06 13:01:02 -08:00
Mitchell Hashimoto
94542b04f2 font/coretext: do not set variation axes in discovery
This was causing discovery to find some odd fonts under certain
scenarios (namely: Recursive Mono). Due to our prior fix in
e08eeb2b2ad810c4db22530a181858caee834b22 we no longer need to set
variations here for them to stick.
2024-11-06 12:57:06 -08:00
Mitchell Hashimoto
964f2ce96a font/coretext: always score based on style string length
This fixes an issue where for the regular style we were picking a
suboptimal style because for some font faces we were choosing more bold
faces (just as chance). This modifies our scoring to take the style
length into account even for regular style. We already had this logic
for explicit styles.
2024-11-06 12:55:03 -08:00
Mitchell Hashimoto
9a74960900 Merge pull request #2598 from NicoElbers/main
docs: fix the nixos install instructions
2024-11-06 11:47:34 -08:00
Paul Berg
1e003b2e0f gtk: implement toggle_split_zoom 2024-11-06 09:59:10 +01:00
Mitchell Hashimoto
ab97645df1 Merge pull request #2606 from ghostty-org/push-ovrqrlvyrkoo
config: add "initial-command" config, "-e" sets that
2024-11-05 17:20:17 -08:00
Mitchell Hashimoto
65f1cefb4e config: add "initial-command" config, "-e" sets that
Fixes #2601

It is more expected behavior that `-e` affects only the first window. By
introducing a dedicated configuration we avoid making `-e` too magical:
its simply syntax sugar for setting the "initial-command" configuration.
2024-11-05 16:58:20 -08:00
Mitchell Hashimoto
98c4c453ee update iterm2 themes 2024-11-05 16:32:30 -08:00
Mitchell Hashimoto
4abff6735b Merge pull request #2605 from ghostty-org/push-zymoylrqolxx
coretext: set variations on deferred face load
2024-11-05 16:23:56 -08:00
Mitchell Hashimoto
e08eeb2b2a coretext: set variations on deferred face load
This commit makes CoreText behave a lot like FreeType where we set the
variation axes on the deferred face load. This fixes a bug where the
`slnt` variation axis could not be set with CoreText with the Monaspace
Argon Variable font.

This was a bug found in Discord. Specifically, with the Monaspace Argon
Variable font, the `slnt` variation axis could not be set with CoreText.
I'm not sure _exactly_ what causes this but I suspect it has to do with
the `slnt` axis being a negative value. I'm not sure if this is a bug
with CoreText or not.

What was happening was that with CoreText, we set the variation axes
during discovery and expect them to be preserved in the resulting
discovered faces. That seems to be true with the `wght` axis but not the
`slnt` axis for whatever reason.
2024-11-05 16:16:25 -08:00
Nico Elbers
34c3da4302 docs: fix the nixos install instructions
Not updating inputs resulted in a crash for me, this fixed it.

Relevant link from discord:
https://discord.com/channels/1005603569187160125/1301217629268213770
2024-11-05 21:57:51 +01:00
Mitchell Hashimoto
fc7ff2a7ef Merge pull request #2512 from reykjalin/fix-hostname-validation-with-macos-wifi-private-address
Make sure a potential port component is considered during hostname validation for OSC 7 handling and shell integration
2024-11-05 10:40:25 -08:00
Mitchell Hashimoto
c8b99f7891 remove refalldecls test 2024-11-05 10:36:16 -08:00
Mitchell Hashimoto
4a263f43af stylistic changes 2024-11-05 10:30:56 -08:00
Mitchell Hashimoto
f9199a4611 Merge pull request #2596 from tristan957/neovim
feat: install neovim plugin
2024-11-04 19:09:22 -08:00
Tristan Partin
16e8095d52 feat: install neovim plugin
$prefix/share/vim/vimfiles is not always read by Neovim. It is
distribution dependent. $prefix/share/nvim/site is a default path for
Neovim however.

Signed-off-by: Tristan Partin <tristan@partin.io>
2024-11-04 19:58:50 -06:00
Kristófer R
9c2f260351 os/hostname: add and use explicit error structs 2024-11-04 19:26:29 -05:00
Kristófer R
e85b114031 os/hostname: add better validation for mac-address hostnames 2024-11-04 18:59:42 -05:00
Kristófer R
9ae6806e30 os/hostname: test bufPrintHostnameFromFileUri
Note that this includes some failing tests because I want to make the
uri handling better and more specific. It's a little bit too general
right now so I want to lock it down to:

1. macOS only; and
2. valid mac address values

because that's how the macOS private Wi-Fi address thing works;
randomizes your mac address and sets that as your hostname.
2024-11-04 18:59:41 -05:00
Kristófer R
78abd051a2 os/hostname: test isLocalHostname 2024-11-04 18:59:41 -05:00
Mitchell Hashimoto
274759d391 Merge pull request #2589 from mnemnion/de-jure
ECMA 48 is de jure: as stated by law
2024-11-04 14:03:11 -08:00
Kristófer R
03bb16fcec Move hostname helpers to src/os/hostname.zig 2024-11-04 16:54:38 -05:00
Mitchell Hashimoto
960e52573b Merge pull request #2591 from ghostty-org/push-qzmuyzpprvmq
update zig-objc
2024-11-04 09:58:20 -08:00
Mitchell Hashimoto
f8d2ac6c8c update zig-objc
removes usingnamespace
2024-11-04 09:52:19 -08:00
Mitchell Hashimoto
21f5a2aa51 README: syntax highlight the config 2024-11-04 09:37:18 -08:00
Sam Atman
c7413bcf57 ECMA 48 is de jure: as stated by law
I am actually not sure if this was meant as a sly pun. It definitely works that way, terminals are _de jour_ meaning _of the day_, but the contrastive with _de facto_  makes me lean toward typo / malaprop. 

The thing is it's a good pun, and I almost let it be for that reason. But I lean towards unintended, so here's a patch, feel free to close it if I read it wrong, er, right? Y'know.
2024-11-03 17:33:35 -10:00
Mitchell Hashimoto
737dc0896d Merge pull request #2581 from FineFindus/fix/adw-headerbar-ghostty-theme
apprt/adw: reapply headerbar colors in toolbarview
2024-11-03 18:43:15 -08:00
Mitchell Hashimoto
3d29ea16f5 Merge pull request #2586 from emilazy/push-zrqyslkkznvo
renderer/metal: prefer low‐power GPUs
2024-11-03 18:34:38 -08:00
Emily
20a77123d4 renderer/metal: prefer low‐power GPUs
Some Intel MacBook Pro laptops have both an integrated and discrete
GPU and support automatically switching between them. The system
uses the integrated GPU by default, but the default Metal device on
those systems is the discrete GPU. This means that Metal‐using
applications activate it by default, presumably as the intended
audience is high‐performance graphics applications.

This is unfortunate for productivity applications like terminals,
however, as the discrete GPU decreases battery life and worsens the
thermal throttling problems these machines have always had. Prefer
to use an integrated GPU when present and not using an external GPU.

The behaviour should be unchanged on Apple Silicon, as the platform
only supports one GPU. I have confirmed that the resulting app runs,
works, and doesn’t activate the AMD GPU on my MacBook Pro, but have
not done any measurements of the resulting performance impact. If
it is considered sufficiently noticeable, a GPU preference setting
could be added.

See <https://github.com/zed-industries/zed/issues/5124>,
<https://github.com/zed-industries/zed/pull/13685>,
<https://github.com/zed-industries/zed/pull/14738>, and
<https://github.com/zed-industries/zed/pull/14744> for discussion,
measurements, and changes relating to this issue in the Zed
project. The logic implemented here reflects what Zed ended up
settling on.

The [Metal documentation] recommends using
`MTLCopyAllDevicesWithObserver` to receive notifications of when
the list of available GPUs changes, such as when [external GPUs
are connected or disconnected]. I didn’t bother implementing that
because it seemed like a lot of fussy work to deal with migrating
everything to a new GPU on the fly just for a niche use case on a
legacy platform. Zed doesn’t implement it and I haven’t heard
about anyone complaining that their computer caught fire when they
unplugged an external GPU, so hopefully it’s fine.

[Metal documentation]: https://developer.apple.com/documentation/metal/gpu_devices_and_work_submission/multi-gpu_systems/finding_multiple_gpus_on_an_intel-based_mac
[external GPUs are connected or disconnected]: https://developer.apple.com/documentation/metal/gpu_devices_and_work_submission/multi-gpu_systems/handling_external_gpu_additions_and_removals

Closes: #2572
2024-11-04 00:35:21 +00:00
Emily
9c8b00f87d renderer/metal: release device on deinit() 2024-11-04 00:21:39 +00:00
Emily
e5f9f222b2 renderer/metal: use release() consistently
I’m not sure why this variation was here previously – maybe it
predated the introduction of `release()`?
2024-11-04 00:21:39 +00:00
Mitchell Hashimoto
9665ff8945 Merge pull request #2588 from ghostty-org/push-wuptulqmurnq
update zig-objc
2024-11-03 15:38:57 -08:00
Mitchell Hashimoto
038b3dec79 update zig-objc
This fixes a hack we had around apple paths since we do this now
upstream in zig-objc. This also adds in support for NSFastEnumeration
needed for #2586
2024-11-03 15:21:26 -08:00