3138 Commits

Author SHA1 Message Date
Mitchell Hashimoto
7b3deb13d8 renderer/metal: apply layerContentsPlacement on macOS to fix stretching
Fixes #42
2024-02-02 08:39:08 -08:00
Mitchell Hashimoto
e5400bad06 config: add window-theme = auto for automatic choosing based on bg color 2024-02-01 20:49:28 -08:00
Erlend Lind Madsen
c418ae577c url: add missing rarer (all) characters allowed in URL 2024-02-02 04:59:13 +01:00
Mitchell Hashimoto
bcab97b1ce Merge pull request #1435 from erf/url-regex
url: add missing url-scheme tests
2024-02-01 18:42:31 -08:00
Erlend Lind Madsen
823aedbb88 url: add missing url-scheme tests 2024-02-02 03:17:24 +01:00
Mitchell Hashimoto
f1fe3d9c88 Merge pull request #1434 from erf/url-regex
url: support dash '-' in urls
2024-02-01 18:17:07 -08:00
Erlend Lind Madsen
a3e2d9d250 url: sort url schemes by most-used 2024-02-02 02:59:55 +01:00
Erlend Lind Madsen
ab8d5e261a url: support dash '-' in urls 2024-02-02 02:45:48 +01:00
Mitchell Hashimoto
6482c25579 macos: titlebar tabs set window appearance based on bg luminance
Fixes #1427
2024-02-01 16:47:45 -08:00
Erlend Lind Madsen
4475f5b9c5 url/Link: simplify regex, remove 'find_longest' param and add new tests 2024-02-02 01:23:39 +01:00
Mitchell Hashimoto
07ebd2e6c0 renderer: only highlight link directly under mouse on line
Related to #1398
2024-02-01 14:01:42 -08:00
Mitchell Hashimoto
88e7c96eac Merge pull request #1431 from mitchellh/mouse-mods-alt
core: handle mouse capture events with link highlighting
2024-02-01 09:20:04 -08:00
Mitchell Hashimoto
6de4533afb core: handle mouse capture events with link highlighting
Fixes #1416

At a high level, the issue is that when mouse capture is enabled (i.e. in
neovim), "shift" escapes the capture. So "cmd+shift" is equal to "cmd"
which doesn't get sent to the TUI program and so on. For link
highlighting which now requires "cmd" (super) is held, we were sending
"cmd+shift" to the renderer so we weren't checking for links.

So the core of this commit is respecting this scenario and stripping the
shift modifier.

This commit also found that when the mouse wasn't over a link, we were
always checking and highlighting links on line one of the visible
screen. This bug is fixed and should also result in a very slight
performance improvement on rendering in all cases.
2024-02-01 09:19:39 -08:00
Mitchell Hashimoto
dcb3c6e78e Merge pull request #1430 from jcollie/csi-n-typo
fix typo in CSI n handling
2024-02-01 09:15:59 -08:00
Jeffrey C. Ollie
67e347070d fix typo in CSI n handling 2024-02-01 10:50:49 -06:00
Mitchell Hashimoto
eafc9559d7 core: add "reset" keybinding to reset the terminal
Fixes #1425
2024-02-01 08:46:39 -08:00
Mitchell Hashimoto
61b964b958 font/freetype: enable bitmap loading for colored faces 2024-02-01 08:40:18 -08:00
Mitchell Hashimoto
e4515d44c5 font/freetype: disallow bitmap strikes in scalable fonts
Fixes #1421
2024-02-01 08:28:33 -08:00
Mitchell Hashimoto
cdae0ac2bd Merge pull request #1423 from allancalix/install-cli
Automatically inject ghostty cli to end of $PATH
2024-01-31 18:58:39 -08:00
Mitchell Hashimoto
c2e0cff1d2 termio/exec: only add ghostty path if it isn't already in path 2024-01-31 18:57:42 -08:00
Mitchell Hashimoto
577b12430c termio/exec: always put ghostty bin dir in GHOSTTY_BIN_DIR env var 2024-01-31 18:50:50 -08:00
Allan Calix
e11d5940ba Automatically inject ghostty cli to end of $PATH 2024-01-31 16:24:15 -08:00
Mitchell Hashimoto
00661c13ab config: clarify some limitations 2024-01-31 10:20:37 -08:00
Qwerasd
ba16d65d02 macOS: Added titlebar tabs 2024-01-30 18:48:36 -05:00
Mitchell Hashimoto
5c0e63458f apprt/embedded: do not allow NaN or small content scales
Fixes #1408
2024-01-29 08:35:23 -08:00
Mitchell Hashimoto
0e46783a5d Merge pull request #1388 from mitchellh/macos-mods
core: send key release events on focus loss
2024-01-28 13:51:29 -08:00
Mitchell Hashimoto
43c105c363 renderer: constrain emoji to cell width
Fixes #1402
2024-01-28 09:07:49 -08:00
Mitchell Hashimoto
cd642eb100 Merge pull request #1405 from mitchellh/term-crash
terminal: avoid reading reset memory for preserving prompt
2024-01-28 09:04:04 -08:00
Mitchell Hashimoto
1ed4827308 Merge pull request #1399 from leafgarland/use-background-for-cursor-text-default
Default to background colour for cursor-text
2024-01-28 09:03:43 -08:00
Mitchell Hashimoto
4b607a07fe terminal: avoid reading reset memory for preserving prompt
Fixes #1400
2024-01-28 08:58:43 -08:00
Mitchell Hashimoto
c871140419 terminal: handle SCOSC/SCORC
Fixes #1401

SCOSC is ambiguous with regards to DECSLRM. This commit copies the logic
of xterm: if left/right mode is enabled, then CSI S is always DECSLRM.
But if left/right mode is disabled then CSI S empty always uses SCOSC.

SCORC always works.
2024-01-28 08:04:14 -08:00
Leaf Garland
d1d7665510 Default to background color for cursor-text
Previously the default was black which doesn't work so well if the
cursor block is dark.
2024-01-28 20:20:40 +13:00
Mitchell Hashimoto
06ff385e0c Merge pull request #1394 from em-dash/configure-scroll-speed
Configure scroll speed  #1378
2024-01-27 21:24:05 -08:00
Mitchell Hashimoto
5095c8f477 core: be explicit about float rounding for mouse scroll multiplier 2024-01-27 21:14:42 -08:00
Mitchell Hashimoto
f65989fd92 Merge pull request #1387 from mattrobenolt/cmd-click
Open links with Super+click
2024-01-27 21:04:51 -08:00
Mitchell Hashimoto
75ca29da59 renderer/link: fix test 2024-01-27 19:34:05 -08:00
Mitchell Hashimoto
9beb395b12 config: update docs 2024-01-27 19:09:03 -08:00
Mitchell Hashimoto
3efe88c85c input: add link highlight always/hover w/ mods 2024-01-27 19:07:49 -08:00
Mitchell Hashimoto
ae11cc9042 add a new highlight state that requires modifiers 2024-01-27 19:03:03 -08:00
em-dash
890fd11fc1 Merge branch 'configure-scroll-speed' of github.com:em-dash/ghostty into configure-scroll-speed 2024-01-28 11:09:13 +11:00
em-dash
ce7ba52b12 Add mouse-scroll-multiplier config option 2024-01-28 11:08:41 +11:00
Mitchell Hashimoto
38607a0f34 Merge pull request #1393 from seruman/single-quoted-urls
config/url: exclude trailing single quotes
2024-01-27 11:23:46 -08:00
Mitchell Hashimoto
0726a8d1fa apprt/embedded: ctrl-only should use binding-mods only
This allows it to ignore control side differences.
2024-01-27 11:15:54 -08:00
Selman Kayrancioglu
9348561bc7 config/url: exclude trailing single quotes 2024-01-27 21:59:37 +03:00
Mitchell Hashimoto
d177b20bab macos: do not trust AppKit's text translation with ctrl only
Normally, when `ctrl+<character>` is pressed, such as `ctrl+z` or
`ctrl+c`, macOS (AppKit) doesn't do any key translation because that
doesn't map to any printable text on its own. Ghostty does the
translation to correctly determine the character is "z" or "c" or
whatever.

For some reason when the keyboard layout is "Dvorak - QWERTY Cmd"
specifically (_not_ plain "Dvorak") on a US layout keyboard, AppKit
decides that "ctrl+z" ("/" on a qwerty keyboard) translates to "/"...
I can't find any explanation for this.

To workaround this, this commit makes it so that if the following
conditions are true, then we IGNORE AppKit's text translation and
manually do it using UCKeyTranslate:

  (1) We're on macOS specifically (not iOS, etc.)
  (2) We have a key event with ONLY control pressed

This fixes `ctrl+z` on this unique Dvorak keyboard layout.
2024-01-27 08:13:53 -08:00
Mitchell Hashimoto
1f4c8f3aa5 core: send key release events on focus loss
Related to #1284

This is highly GUI toolkit specific, but it is impossible to receive
events for some key releases when focus is lost while the keys are still
behind held. This commit always sends a release event for the last
pressed key when focus is lost, including each individual modifier.

On macOS, AppKit sends a key release event to a view if a prior press
event was sent, but only for non-modifier keys. This means that with
this commit (1) the full key release event is repeated but (2) modifier
release events are now properly sent.

On Linux with GTK, GTK sends modifier release events but not key release
events. This means that the behavior is inverted from macOS!

The result of this commit is that key release events _may be repeated_
on focus loss, but it ensures that all prior key+modifiers for the most
recent press event are released. This will require that TUI apps
handling release apps are idempotent in their release handling but I
don't think thats unrealistic to expect and I've already been able to
demonstrate at least Kitty sending duplicate release events in some
scenarios so this seems like a safe assumption.
2024-01-27 07:49:04 -08:00
Matt Robenolt
5813488691 Update Config docs to suggest Super + hover is required for link activation 2024-01-26 20:56:34 -08:00
Matt Robenolt
e70ec5d5f4 Only detect links when Super is held down
This stops underlining and changing to a pointer unless Cmd or Ctrl is
held down already.
2024-01-26 20:52:00 -08:00
Matt Robenolt
6c6b42d40c Open links with Super+click
A few people, including myself, many times accidentally click links by
either clicking around aimlessly or getting focus back to Ghostty that
happens to be hovering over a link.

In iTerm2, if you want links enabled, it's always Cmd+Click.
2024-01-26 20:23:40 -08:00
Mitchell Hashimoto
26c7215cf8 forgot commit to get #1363 building to new API 2024-01-26 09:04:32 -08:00