4461 Commits

Author SHA1 Message Date
Mitchell Hashimoto
25342f545b macos: add update delegate so we can configure some behavior 2023-12-18 19:09:45 -08:00
Mitchell Hashimoto
f192ffd5bc macos: boilerplate to setup updater menu item 2023-12-18 19:09:45 -08:00
Mitchell Hashimoto
caf6ebc6ef macos: add Sparkle via Swift PM 2023-12-18 19:09:38 -08:00
Mitchell Hashimoto
18f205e78c Merge pull request #1124 from mitchellh/macos-build
macos: put build numbers back into info.plist, other metadata
2023-12-18 19:07:38 -08:00
Mitchell Hashimoto
68a23e786d macos: put build numbers back into info.plist, other metadata
This adds more metadata back into the Info.plist for a build. This
metadata is used with the About window. The reason I want the build
number back is so that we have a monotonically increasing number to do
self-updating with (i.e. Sparkle).
2023-12-18 18:56:34 -08:00
Mitchell Hashimoto
a8419754b9 renderer/opengl: allow OpenGL 4.1/4.2 2023-12-18 13:59:33 -08:00
Mitchell Hashimoto
463e4fd689 Merge pull request #1123 from mitchellh/opengl-version
renderer/opengl: error if OpenGL version is too old
2023-12-18 13:01:00 -08:00
Mitchell Hashimoto
4ba44fb8c1 renderer/opengl: error if OpenGL version is too old
This returns an error from the renderer implementation. This error just
crashes Ghostty currently with a stack trace. We can handle the error
later but for now it makes it a lot more obvious why certain error
scenarios happen.
2023-12-18 12:51:53 -08:00
Tim Culverhouse
e92f8b28d5 cli: parse args as command when launched as 'xdg-terminal-exec'
[xdg-terminal-exec](https://github.com/Vladimir-csp/xdg-terminal-exec)
is a proposal to allow users to define a "default" terminal to use when
launching applications which have `Terminal=true` in their desktop file.
Users can symlink their terminal of choice to `xdg-terminal-exec`, which
is the first option used in the GIO launch options, and is gaining
traction elsewhere.

When launched as `xdg-terminal-exec`, ghostty must parse any args as the
command. Add a special case using the same logic as the '-e' flag to
enable ghostty to be launched in this manner.

Fixes: https://github.com/mitchellh/ghostty/issues/658
2023-12-18 12:54:02 -06:00
Tim Culverhouse
5946bc1a53 cli: invert special case arg parsing logic
Invert special case logic so that we can add additional cases. The
previous logic bailed if we weren't the only special case ('-e').
2023-12-18 12:37:23 -06:00
Mitchell Hashimoto
b711ac8a42 apprt/glfw: implement openconfig 2023-12-18 08:20:29 -08:00
Mitchell Hashimoto
9c0de96c79 Merge pull request #1116 from clebs/feature/settings-shortcut
macos: Add settings shortcut
2023-12-18 08:08:48 -08:00
Mitchell Hashimoto
aa9b7cd2e9 input: clarify some limitations of opening config 2023-12-18 08:07:41 -08:00
Mitchell Hashimoto
2c311ab369 apprt/gtk: hook up open config 2023-12-18 08:04:24 -08:00
Mitchell Hashimoto
7600c761ef fix callback struct ordering, use internal_os.open 2023-12-18 08:00:40 -08:00
Mitchell Hashimoto
f3b242a9a4 Merge pull request #1120 from mitchellh/macos-close-all
macos: close all windows
2023-12-17 20:56:20 -08:00
Mitchell Hashimoto
97433d3aa1 macos: close all windows
Fixes #1052

This implements a `close_all_windows` binding in the core and implements
it for macOS specifically. This will ask for close confirmation if any
surface in any of the windows requires confirmation.

This is bound by default to option+shift+command+w to match Safari. The
binding is generall option+command+w but users may expect this to also
mean "Close All Other Tabs" which is the changed behavior if any tabs
are present in a standard macOS application. So I chose to follow Safari
instead.

This doesn't implement this feature for GTK, that's left as an exercise
for a contributor.
2023-12-17 20:54:57 -08:00
Mitchell Hashimoto
b6ed5f7e4a Merge pull request #1119 from mitchellh/macos-close-win
macos: close_window binding works properly again
2023-12-17 20:30:21 -08:00
Mitchell Hashimoto
20ba6f3d78 macos: close_window binding works properly again
This binding closes the physical window and all surfaces in that window.
2023-12-17 20:29:23 -08:00
Mitchell Hashimoto
765fbdb4f1 Merge pull request #1118 from mitchellh/gtk-tab
input: translate '\t' to Key.tab
2023-12-17 20:16:27 -08:00
Mitchell Hashimoto
c97f6ac027 input: translate '\t' to Key.tab
This allows bindings with `tab` to work properly on Linux. The issue is
that in the key translation, we weren't mapping this and thought it was
invalid IME input so we were ignoring it.
2023-12-17 20:14:41 -08:00
Mitchell Hashimoto
7ae45b522a Merge pull request #1117 from mitchellh/macos-about
macos: custom about window so we can be a first responder
2023-12-17 15:51:50 -08:00
Mitchell Hashimoto
2e74a0f9d4 macos: custom about window so we can be a first responder
Fixes #1052

This implements the about window as a custom window with a view
controller. This lets us implement the proper responder chain so that
our custom close window IBActions do the right thing.

This has an additional benefit that we can easily customize this window
going forward.
2023-12-17 15:51:04 -08:00
Mitchell Hashimoto
4c228660c5 Merge pull request #1109 from cespare/linux-install-deps
update README with Linux dependency tips
2023-12-17 15:00:02 -08:00
Mitchell Hashimoto
548f59566d Merge pull request #1114 from vancluever/vancluever-powerline-no-constrain
renderer: don't constrain Powerline glyphs
2023-12-17 07:47:38 -08:00
Borja Clemente
646e3c365c Add settings shortcut on MacOS
- Settings shortcut opens the config file in the default editor.

Signed-off-by: Borja Clemente <borja.clemente@gmail.com>
2023-12-17 16:19:22 +01:00
Chris Marchesi
fad0b9a49c renderer: don't constrain Powerline glyphs
This adds the Powerline glyphs to the exemptions from the PUA
constraints put in as a part of #1110.

While Powerline is considered to part of the Nerd Font group, the
constraint behavior seems to cause issues with some setups - e.g.
powerlevel10k prompts where characters immediately follow a Powerline
character.

Only the codes given as shapes below are included:
  https://github.com/ryanoasis/powerline-extra-symbols/blob/master/img/fontforge.png

Fixes #1113, where the issue can be seen.
2023-12-16 23:18:49 -08:00
Mitchell Hashimoto
5eea79ad0d Merge pull request #1112 from vancluever/vancluever-fix-hidden-mouse-typing
Surface: ensure keyToMouseShape respects hidden state
2023-12-16 22:36:01 -08:00
Chris Marchesi
a6aad756e5 Surface: ensure keyToMouseShape respects hidden state
This fixes keyToMouseShape (the new handler for mouse shape state for
key combinations, e.g. during mouse tracking override or rectangle
select) so that it respects whether or not the mouse is currently
hidden, and will not send back a shape to change the mouse to in these
situations.

Fixes #1107.
2023-12-16 22:29:01 -08:00
Mitchell Hashimoto
ec2bc74a22 Merge pull request #1111 from mitchellh/adjust-width
font: center text when adjust-cell-width is used
2023-12-16 20:58:22 -08:00
Mitchell Hashimoto
481529393b font: center text when adjust-cell-width is used
Fixes #1086
2023-12-16 20:56:57 -08:00
Mitchell Hashimoto
b622df64b2 Merge pull request #1110 from mitchellh/shape
renderer: characters in the Unicode PUA (private use area) are scaled if not followed by whitespace
2023-12-16 20:31:33 -08:00
Mitchell Hashimoto
9178fabc5d renderer: also constrain PUA chars if preceded by PUA 2023-12-16 20:18:14 -08:00
Mitchell Hashimoto
231a2b6369 renderer/opengl: implement fg_constrained 2023-12-16 20:11:37 -08:00
Mitchell Hashimoto
0b658c8217 renderer/metal: constrain PUA glyphs if they aren't next to space 2023-12-16 20:07:25 -08:00
Mitchell Hashimoto
2da5ec2c28 Merge pull request #1108 from cespare/url-boundary-regex
config: improve link matching for URLs ending in . or )
2023-12-16 19:28:02 -08:00
Caleb Spare
0ab1b061cc update README with Linux dependency tips 2023-12-16 18:39:13 -08:00
Caleb Spare
ae94af37c0 config: improve link matching for URLs ending in . or )
Fixes #1098
2023-12-16 17:34:38 -08:00
Mitchell Hashimoto
fd80889f9a Merge pull request #1104 from meatcar/gtk-icons-fix
nix: use wrapGAppsHook to package ghostty
2023-12-16 14:23:08 -08:00
Mitchell Hashimoto
d796d1259b nix: only add shellhook on linux 2023-12-16 14:14:53 -08:00
Mitchell Hashimoto
30d3928e0f termio: allocate initial capacity more accurately 2023-12-16 14:04:58 -08:00
Denys Pavlov
212a95866a nix: fix GTK icons for debug builds
Set `XDG_DATA_DIRS` in `nix develop` shell to include default Gnome
icon sets and gsettings schemas.

Sourced from [nixos wiki](https://nixos.wiki/wiki/Development_environment_with_nix-shell#No_GSettings_schemas_are_installed_on_the_system).
2023-12-16 13:15:03 -05:00
Denys Pavlov
82f102224f nix: use wrapGAppsHook4 to package ghostty
`wrapGAppsHook4` is recommended by nixpkgs for packaging GTK4
applications.[1] It ensures `XDG_DATA_DIRS` includes the nescessary
icons and gsettings schemas.
2023-12-16 13:04:54 -05:00
Denys Pavlov
33ebda5633 nix: teach direnv about flake.nix imports
direnv now watches flake.nix dependencies in `nix/`, reloading
the environment on any changes.
2023-12-16 12:58:17 -05:00
Mitchell Hashimoto
e4dc9845ed Merge pull request #979 from vancluever/vancluever-rect-crosshair
Surface: set crosshair, change event processing logic for mouse tracking
2023-12-16 08:08:11 -08:00
Mitchell Hashimoto
add6bfe0df Merge pull request #1106 from mitchellh/macos-zsh
macos: do not load zsh config on the outer zsh launch
2023-12-16 08:00:29 -08:00
Mitchell Hashimoto
a8ef7d73d7 macos: do not load zsh config on the outer zsh launch
Related to #1102, #1074

Because we are now using the built-in zsh on macOS to launch the real
shell the user wants to use (see #1102 for why), this "outer zsh"
process was consuming our shell integration setup.

This commit adds flags so that this zsh instance doesn't load local
zshrc files and therefore doesn't consume our shell integration setup.
2023-12-16 07:54:10 -08:00
Chris Marchesi
6e8ed4e8b3 Surface: set crosshair, change event processing logic for mouse tracking
This work is mainly targeted at adding the crosshair for when
ctrl/super+alt is pressed. We also add this for when mouse tracking is
enabled so that we show the crosshair when ctrl/super+alt+shift is
pressed at the same time.

I've also changed the event processing logic here because the amount of
keys we have to process has greatly increased. Instead of processing
each individual event, we now process the modifier state.

Additionally, some refactoring has been done geared at starting to
re-work the mouse for the core surface into a something stateful. My
hope is that we can continue to unravel some of this from the core
surface so that we can process key inputs, motion events, and anything
else relevant as inputs to transitions for shape display, click
behavior, etc.

This commit now also moves the ctrlOrSuper handlers to respective parts
in the Key hierarchy, while also adding additional helpers for other
modifiers.
2023-12-15 19:23:10 -08:00
Mitchell Hashimoto
8464010903 Merge pull request #1105 from mitchellh/kitty-lock
renderer/opengl: acquire lock to prep kitty images
2023-12-15 14:47:30 -08:00
Mitchell Hashimoto
5b4232b094 renderer/opengl: acquire lock to prep kitty images
Fixes #1101

GTK forces all GLArea drawing to happen on the GUI thread. In this
scenario, `updateFrame` and `drawFrame` could be happening in parallel.
This commit grabs the lock while updating the Kitty image protocol state
since that is used by both functions.

We already have a mutex called "draw_mutex" that we hold while we're
modifying data that could be shared by this separate draw thread. We
should reuse that here.
2023-12-15 14:15:32 -08:00