4950 Commits

Author SHA1 Message Date
Mitchell Hashimoto
f2aaa73a4d Merge pull request #1395 from iynaix/meta-main-program
nix: Add meta.mainProgram
2024-01-27 18:54:12 -08:00
Lin Xianyi
6a720564b6 nix: Add meta.mainProgram 2024-01-28 10:22:38 +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
79d936e8e4 Merge pull request #1391 from mitchellh/macos-fs
macos: make global macOS fullscreen keybind work
2024-01-27 09:58:52 -08:00
Mitchell Hashimoto
a41ee3cabe macos: make global macOS fullscreen keybind work
Fixes #1389

This is just a fun AppKit quirk. This menu item is set automatically
based on the keyboard shortcut (apparently) and when its overwritten
then its gone forever. So, let's just not set it.
2024-01-27 09:58:02 -08:00
Mitchell Hashimoto
8b9fd23f01 Merge pull request #1390 from mitchellh/dvorak
macos: do not trust AppKit's text translation with ctrl only
2024-01-27 09:46:12 -08: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
894554f1a0 Merge pull request #1385 from mitchellh/update-zig
update zig
2024-01-26 09:42:47 -08:00
Mitchell Hashimoto
55cac84f5e ci: temporarily disable windows builds while Zig regression is fixed 2024-01-26 09:19:31 -08:00
Mitchell Hashimoto
26c7215cf8 forgot commit to get #1363 building to new API 2024-01-26 09:04:32 -08:00
Mitchell Hashimoto
d50307c219 Merge pull request #1363 from jcollie/list-keybinds-docs
Add option to include docs when listing keybinds.
2024-01-26 09:02:49 -08:00
Mitchell Hashimoto
0ba3edaf3d very small style change 2024-01-26 09:01:27 -08:00
Mitchell Hashimoto
efda4c232a update zig 2024-01-26 08:56:24 -08:00
Mitchell Hashimoto
b436c64be7 Merge pull request #1384 from mitchellh/apple-sdk-fix
apple-sdk: use zig's libstd getSdk to get active Apple SDK
2024-01-26 08:53:30 -08:00
Mitchell Hashimoto
2f5f14df9f pkg/apple-sdk: use std.zig.system.darwin.getSdk 2024-01-26 08:31:30 -08:00
Jakub Konka
f98b5b7417 apple-sdk: use zig's libstd getSdk to get active Apple SDK 2024-01-26 12:04:49 +01:00
Mitchell Hashimoto
0972562a96 Merge pull request #1383 from vancluever/vancluever-update-nixpkgs-zig-0-12
nix: update nixpkgs-zig-0-12
2024-01-25 22:10:56 -08:00
Chris Marchesi
0b8da6bcd7 nix: update nixpkgs-zig-0-12
This updates the nixpkgs-zig-0-12 to be in line with the current overlay
Zig (0.12.0-dev.2334+aef1da163).
2024-01-25 21:46:01 -08:00
Mitchell Hashimoto
e3996e3502 Merge pull request #1382 from mitchellh/pua-scaling
renderer: consider powerline box glyphs whitespace for PUA scaling
2024-01-25 15:45:07 -08:00
Mitchell Hashimoto
1907c58972 renderer: consider powerline box glyphs whitespace for PUA scaling
This adds to the heuristics introduced for #1071. Please read that issue
and associated PRs in their entirety to understand this commit.

This extends our concept of "whitespace" to include powerline box
glyphs. We don't want to constrain nerd symbols next to powerline box
glyphs because box glyphs are often used to style and contain nerd
glyphs. For example, its common to see a right-facing semi-circle, then
a nerd font glyph, then a left-facing semi-circle to create a
pill-shaped label.

This allows those nerd font symbols to be rendered full size. Test
script below (copy the bytes):

    printf "󰃰\n"
    printf "󰃰 \n"
    printf "󰃰\n"
2024-01-25 15:35:48 -08:00
Mitchell Hashimoto
a8b7ddbc88 Merge pull request #1380 from mitchellh/ctrlseqs
input: handle more ctrl+<key> sequences, namely ctrl+_
2024-01-25 15:29:41 -08:00
Mitchell Hashimoto
9ecd319a72 Merge pull request #1381 from mitsuhiko/document-reload-for-padding
Document that window padding changes need a restart
2024-01-25 15:28:42 -08:00
Mitchell Hashimoto
bf4211e060 input: handle more ctrl+<key> sequences, namely ctrl+_
Previously, we encoded `ctrl+_` in the CSIu format[1]. This breaks most
notably emacs which expects the legacy ambiguous encoding.

This commit utilizes the generator from Kitty to generate our control
key mappings. We also switch from keycode mapping to key contents
mapping which appears to be the correct behavior also compared to other
terminals.

In the course of doing this, I also found one bug with our fixterms
implementation. Fixterms states: "The Shift key should not be considered
as a modifier for Unicode characters, because it is most likely used to
obtain the character in the first place (e.g. the shift key is often
required to obtain the ! symbol)." We were not applying that logic and
now do.

[1]: https://www.leonerd.org.uk/hacks/fixterms/
2024-01-25 15:25:23 -08:00
Armin Ronacher
6f82004183 Document that window padding changes need a restart 2024-01-26 00:09:16 +01:00
Mitchell Hashimoto
5fa34908e4 Merge pull request #1376 from mitchellh/grapheme-scroll
terminal: preserve multi-point grapheme clusters on scrollback deletion
2024-01-25 09:47:26 -08:00
Mitchell Hashimoto
2d612ab168 terminal: preserve multi-point grapheme clusters on scrollback deletion
This codepath was not previously tested (an accident). Upon testing
this codepath its clear to see the logic was incorrect. When we have to
remove rows from our scrollback to fit new rows in the circular buffer,
we have to delete graphemes, but we were deleting them from the wrong
row offset.

For the row offset, we previously used the _active_ screen but the
proper offset is the _full_ screen. Tests verify.
2024-01-25 09:35:56 -08:00
Mitchell Hashimoto
066202b378 Merge pull request #1374 from mitchellh/kitty-placements
kitty graphics: use internal ID for placements with ID 0
2024-01-24 22:30:17 -08:00
Mitchell Hashimoto
238361698b kitty graphics: use internal ID for placements with ID 0
Fixes #1356 correctly.

This was previously fixed by #1360 which just assigned a random
placement ID. I asked the Kitty maintainer about this and this is not
the correct logic and the spec has been updated.

When a placement ID of zero is sent, we allow multiple placements but
use an internal, non-addressable placement ID. The issue with my
previous approach was someone with knowledge of internals (or luck)
could technically address the placement. This isn't allowed.
2024-01-24 22:17:13 -08:00
Mitchell Hashimoto
bf658d32c3 Merge pull request #1371 from mitchellh/update-zig
update zig
2024-01-24 09:53:41 -08:00
Mitchell Hashimoto
2a2c17e198 update zig 2024-01-24 09:36:48 -08:00
Mitchell Hashimoto
b050a9cf93 Merge pull request #1370 from mitchellh/config-replay
config: re-expand relative paths correctly when reloading config
2024-01-23 22:33:24 -08:00
Mitchell Hashimoto
0f133ae4a7 config: re-expand relative paths correctly when reloading config
Fixes #1366

When we use `loadTheme`, we "replay" the configuration so that the theme
is the base configuration and everything else can override everything
the theme sets. During this process, we were not properly re-expanding
all the relative paths.

This fix works by changing our input tracking from solely tracking args
to tracking operations such as expansion as well. When we "replay" the
configuration we also replay operations such as path expansion with the
correct base path.

This also removes the `_inputs` special mechanism `cli/args.zig` had
because we can already do that ourselves using `parseManuallyHook`.
2024-01-23 21:59:34 -08:00
Mitchell Hashimoto
3beae1a4c4 Merge pull request #1368 from mitchellh/config-default
empty cli or config args reset the value to the default
2024-01-23 19:08:02 -08:00
Mitchell Hashimoto
c9371500c9 empty cli or config args reset the value to the default
Fixes #1367

We previously special-cased optionals but we should do better and have
this reset ANY type to the defined default value on the struct.
2024-01-23 18:57:33 -08:00
Mitchell Hashimoto
78a5f64e84 Merge pull request #1365 from mitchellh/metal-mode
renderer/metal: only set shared texture mode on aarch64
2024-01-23 14:24:27 -08:00
Mitchell Hashimoto
aa147413c7 renderer/metal: only set shared texture mode on aarch64
This setting is only supported on aarch64.
2024-01-23 14:09:48 -08:00
Mitchell Hashimoto
764a07fa16 Merge pull request #1364 from mitchellh/title-utf8
terminal: ignore change window title requests with invalid UTF-8
2024-01-23 12:09:45 -08:00
Mitchell Hashimoto
f445ee269f terminal: ignore change window title requests with invalid UTF-8 2024-01-23 11:52:56 -08:00
Jeffrey C. Ollie
d51b6d4799 Add option to include docs when listing keybinds. 2024-01-23 00:26:38 -06:00
Mitchell Hashimoto
0a47224a4e Merge pull request #1362 from mitchellh/JC/atlas-texture-shared
Shared Atlas Texture on Metal
2024-01-22 19:07:11 -08:00
jcalabro
bc972a4c44 set the atlas texture memory storage mode to shared 2024-01-22 21:24:03 -05:00
Mitchell Hashimoto
63139ad7e4 Merge pull request #1361 from gabydd/format-action
don't write ":" when printing keybinding action with no argument
2024-01-22 18:04:58 -08:00