559 Commits

Author SHA1 Message Date
Mitchell Hashimoto
d5a23e78fe
macos: some disabled swiftui code that makes link tooltips show 2024-07-06 10:01:35 -07:00
Mitchell Hashimoto
e3f299ac80
macos: relabel tabs when mergeAllWindows is called
Fixes #1902
2024-07-02 14:08:21 -07:00
Mitchell Hashimoto
7fbc73ad37
macos: implement ctrl+command+d for quicklook under cursor 2024-07-01 10:08:38 -07:00
Mitchell Hashimoto
57d71450ab
ctrl+click is handled as right-click (with various details)
If mouse capturing is enabled, we encode ctrl+click as ctrl+left-click
and DO NOT handle it as right click.
2024-06-30 19:44:51 -07:00
Mitchell Hashimoto
1d70e822c5
macos: disable macOS-only API on iOS 2024-06-30 19:03:06 -07:00
Mitchell Hashimoto
f0737356cb
macos: i don't like windowing in the context menu 2024-06-30 15:19:59 -07:00
Mitchell Hashimoto
174d83bfd3
macos: add windowing commands to context menu 2024-06-30 15:18:33 -07:00
Mitchell Hashimoto
6c01d20eb7
macos: add string extension 2024-06-30 14:58:28 -07:00
Mitchell Hashimoto
a771d65735
macos: start context-menu 2024-06-30 10:15:36 -07:00
Mitchell Hashimoto
03f37087a5
mouse button callbacks returns bool for consumption 2024-06-30 09:42:15 -07:00
Mitchell Hashimoto
46a0cbf9d7
macos: remove log statement 2024-06-30 09:18:13 -07:00
Mitchell Hashimoto
afc172728f
macos: offset quicklook box a bit to look better (imo) 2024-06-29 11:31:12 -05:00
Mitchell Hashimoto
26735f0e05
apprt: convert selection info to a single struct and C API 2024-06-29 11:23:14 -05:00
Mitchell Hashimoto
80700d524d
macos: add API to get selection top-left for quicklook 2024-06-29 10:42:45 -05:00
Mitchell Hashimoto
4c3fbffa4b
macos: return valid selection range 2024-06-29 10:42:45 -05:00
Mitchell Hashimoto
d5f27245d4
macos: hacky API to get a CTFont for QuickLook 2024-06-29 10:42:45 -05:00
Mitchell Hashimoto
280b8efacc
macos: I don't need any custom quicklook stuff 2024-06-29 10:42:45 -05:00
Mitchell Hashimoto
99faeab649
macos: release pressure on mouseUp 2024-06-29 10:42:45 -05:00
Mitchell Hashimoto
6faeb9ba40
core: mouse pressure state and callbacks 2024-06-29 10:42:45 -05:00
Mitchell Hashimoto
c165cef0a6
macos: initialize some pressure click boilerplate 2024-06-29 10:42:44 -05:00
Mitchell Hashimoto
c9c1bd0531
macos: titlebar tabs should do nothing if no titlebar
Fixes #1876
2024-06-25 10:03:05 -07:00
Mitchell Hashimoto
067db2af18
Merge pull request #1858 from SkamDart/focus-follows-mouse
feat: focus follows mouse for splits
2024-06-18 17:09:54 -04:00
Mitchell Hashimoto
50019bc766
minor comment changes 2024-06-18 17:09:29 -04:00
Robbie Vanbrabant
693a599084 macos: regain window focus on inspector toggle
Fixes #734

I don't know much about SwiftUI, but here's why I think this works.

- Moving the `inspectorVisible` logic to an `onChange` ensures the view
  has at least seen that change.
- The dispatch to the main thread is still necessary to ensure the view
  hierarchy has completely updated after `inspectorVisible`.

Note that this fix is to correctly regain focus. We still lose window
focus very briefly.
2024-06-14 19:22:50 +01:00
Cameron Dart
92e16ccbf7 no early return 2024-06-10 18:23:06 -07:00
Cameron Dart
fc52acd47a update config in TerminalController.windowDidLoad and TerminalController.configDidReload 2024-06-10 18:22:28 -07:00
Cameron Dart
29fb70197c macos: surface focus follow mouse 2024-06-10 16:07:33 -07:00
Cameron Dart
97bb595505 macos: add to config 2024-06-10 16:06:57 -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
5a026cf1a2
macos: set background color on transparency that matches Terminal.app 2024-06-07 12:35:57 -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
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
Jon Parise
2a66d37e48 Update functional URLs for ghostty-org 2024-06-01 16:44:09 -04:00
Troels Thomsen
f79674097f Avoid coloring when using native tabs 2024-05-21 08:58:51 +02:00
Mitchell Hashimoto
47874742a1 Extract guard statement 2024-05-21 08:58:10 +02:00
Troels Thomsen
242858b963 Color after setting window theme and tab mode 2024-05-21 08:05:55 +02:00
Troels Thomsen
6366d562ca Recognize system theme 2024-05-19 23:01:09 +02:00
Mitchell Hashimoto
eee58b9ce6
macos: titlebar styling always applies to titlebar tabs 2024-05-17 20:38:51 -04:00
Mitchell Hashimoto
92d551a3c1
macos: only set bg color and titlebar color if opaque
Fixes #1771

I'm not convinced this fix won't regress some other behavior, but in my
titlebar tab and native tab modes with and without transparency, this
has looked okay to me.
2024-05-17 17:05:21 -04:00
Mitchell Hashimoto
69a3137956
macos: use enum for window theme 2024-05-17 16:31:18 -04:00
Pete Schaffner
c437416014 Make title/tab bar respect window-theme setting 2024-05-14 20:17:28 -04:00
Mitchell Hashimoto
d2adf0501c
macos: ime coordinate needs to be converted from view to window coords
Fixes #1756

We previously converted from view to screen coordinates but if the view
doesn't take up the full window then the view coordinates are wrong. We
need to convert to window coordinates in the middle.
2024-05-10 20:45:51 -07:00
cryptocode
a304c953bf
Rename menu item variable name accordingly 2024-05-10 12:08:19 +02:00
cryptocode
2faa0c9bee
Rename Split Horizontally/Vertically to Split Right/Down
I make the following suggestion through a PR since I already tried this locally and have a branch ready:

- Rename Split Horizontally to Split Right
- Rename Split Vertically to Split Down

Rationale:

The terms horizontal and vertical are ambiguous in the context of splitting (does it mean the splitter is vertical, or are the panes organized vertically?)
Different apps pick different interpretations, so people get confused.

IntelliJ made the same change as above based on user feedback: https://youtrack.jetbrains.com/issue/IJPL-130991/Split-Vertically-and-Split-Horizontally-are-ambiguous-and-should-be-renamed

Ghostty is using the left/right nomenclature in other menu items. In the codebase, SplitDirection is already left/right.
2024-05-10 11:17:11 +02:00
Qwerasd
5df0935f82 update font_size to f32 in libghostty 2024-05-09 00:03:40 -04:00
Mitchell Hashimoto
ca9689be46
renderer/metal: API to handle macOS display ID changing 2024-05-04 19:40:58 -07:00
Mitchell Hashimoto
e31e25f54d
apprt/embedded: add draw now API 2024-05-04 14:49:49 -07:00
Mitchell Hashimoto
45eecf801e
macos: show alert when creating new tab in non-native fs
Fixes #1683

The root issue is #392 and we can likely find a way to fix it, but for
now let's prevent the full program hang by showing an alert.
2024-04-16 09:34:10 -07:00