448 Commits

Author SHA1 Message Date
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
6faeb9ba40 core: mouse pressure state and callbacks 2024-06-29 10:42:45 -05:00
Mitchell Hashimoto
c3f78bc69d core: mouse within top/bottom 1 pixel should scroll selection
Fixes #1892

We previously required a negative y or y beyond the height of the window
but in a full screen scenario neither happen, so we add a one pixel
buffer instead where we still scroll.
2024-06-28 23:45:42 -05:00
Mitchell Hashimoto
c69dc0e0e1 migrate termio.Options.LinuxCgroup to Command 2024-06-08 19:10:19 -07:00
Mitchell Hashimoto
e2772eacec Merge pull request #1846 from kdrag0n/buffered-scrollback-file
scrollback: buffer writes to scrollback file
2024-06-08 14:56:13 -07:00
Mitchell Hashimoto
fb7cbd69c0 core: consider any paste with bracketed paste closer unsafe
Thanks to: https://thejh.net/misc/website-terminal-copy-paste

If a paste has the ending sentinel value for a bracketed paste
("\x1b[201~") then the shell may start processing data faster. We now
consider this unsafe even if the `clipboard-paste-bracketed-safe`
setting is true.
2024-06-08 14:38:49 -07:00
Danny Lin
197b873dee scrollback: buffer writes to scrollback file
Screen.dumpString writes one character at a time, so buffer writes to
the scrollback file to speed it up.
2024-06-07 20:52:08 -07:00
Mitchell Hashimoto
1093ccecb4 xdg-terminal-exec invocations set title based on command
Fixes #1724

See background in #1724. The general idea is that for Ghostty
invocations via xdg-terminal-exec, we set the initial title to the
command automatically so that window managers can modify the styling.

We only do this for xdg-terminal-exec because that protocol/spec is
specifically for the scenario that the terminal is being used to launch
a command from the desktop environment.
2024-06-06 10:01:32 -07:00
Mitchell Hashimoto
dc51b8269c plumb the linux cgroup through to termio 2024-06-04 21:37:34 -07:00
Mitchell Hashimoto
cd7da9eb4b inspector: fix encoding of pty-encoded key event 2024-06-03 18:40:52 -07:00
Mitchell Hashimoto
30c1ab737c core: only hide mouse on key press events
see comment
2024-06-03 15:04:19 -07:00
Mitchell Hashimoto
ac554c74ff core: do not toggle mouse hidden on keyCallback with mods
If the mouse was hidden, we just keep it hidden.
2024-06-03 14:55:21 -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
cryptocode
0b6081d427 scrollback: Include active area when writing scrollback to file
Writing scrollback to file is, among other usecases, an interrim solution for searching.
Status quo is to only write history pages, and not the active area. This PR proposes that
the scrollback write includes the active area, which I think is more useful. For example,
you can then do less +G <super+shift+j> if you have long log output and then page and
reverse-search through all of it. It's a bit surprising if the active area is missing.
2024-05-29 15:19:45 +02:00
Mitchell Hashimoto
ded7c0abac Merge pull request #1760 from jcollie/notification-suppression
Rate limit desktop notifications
2024-05-26 20:50:19 -07:00
Mitchell Hashimoto
98b05ffd09 core: nitpick some var names 2024-05-26 20:49:00 -07: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
6307162e49 small comment changes 2024-05-17 16:46:30 -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
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
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
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
0335b0eada core: preedit modification sets full screen dirty
Fixes #1735
2024-05-07 19:19:58 -07:00
Mitchell Hashimoto
e31e25f54d apprt/embedded: add draw now API 2024-05-04 14:49:49 -07:00
Mitchell Hashimoto
506ba854fa core: font size changes work 2024-04-06 19:33:49 -07:00
Mitchell Hashimoto
f51dad445f core: add todo for next time 2024-04-06 10:56:21 -07:00
Mitchell Hashimoto
b8d11e57c9 renderer/Metal: change font size works again 2024-04-06 10:55:58 -07:00
Mitchell Hashimoto
b9efd83798 font: SharedGridSet uses DerivedConfig 2024-04-06 10:37:26 -07:00
Mitchell Hashimoto
04e0cd29e5 core: begin converting to SharedGridSet, renderers still broken 2024-04-05 15:25:45 -07:00
Mitchell Hashimoto
5de88fe3f8 core: deref the font group when not used 2024-04-05 09:29:40 -07:00
Mitchell Hashimoto
6d7053a1ad core: convert surface/app to use GroupCacheSet 2024-04-05 09:29:40 -07:00
Mitchell Hashimoto
2a386daa19 font: GroupCacheSet.Key has metric modifiers 2024-04-05 09:29:40 -07:00
Mitchell Hashimoto
9d8da8fcc7 font: CodepointMap hashable, use for groupcacheset 2024-04-05 09:29:40 -07:00
Mitchell Hashimoto
bfcd5f380a font: introduce GroupCacheSet, use it for descriptors to start 2024-04-05 09:29:40 -07:00
Qwerasd
624ebb5b51 fix(inspector): cell picker in scrollback
Previously cell picking only worked correctly in the active area, not when scrolled in to scrollback.
2024-04-04 20:39:39 -04:00
Mitchell Hashimoto
5664c3e3c9 core: enable link hovering 2024-03-22 20:28:05 -07:00
Mitchell Hashimoto
bca51ee771 terminal: selectionString takes a struct for opts 2024-03-22 20:28:05 -07:00
Mitchell Hashimoto
2de86ce500 core: converting more to new screen state 2024-03-22 20:28:05 -07:00
Mitchell Hashimoto
f4fa54984c terminal: selectLine can disable whitespace/sem prompt splitting 2024-03-22 20:28:05 -07:00
Mitchell Hashimoto
172d62ca12 inspector: get mouse points working 2024-03-22 20:28:04 -07:00
Mitchell Hashimoto
9015b7548f inspector: support cell pinning again 2024-03-22 20:28:04 -07:00
Mitchell Hashimoto
935063d892 core: scroll to selection working 2024-03-22 20:28:01 -07:00
Mitchell Hashimoto
1527936f90 core: only adjust selection on keypress 2024-03-22 20:28:01 -07:00
Mitchell Hashimoto
d805fdd672 core: mouse untracks pin in right screen 2024-03-22 20:28:00 -07:00