3138 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
gabydd
6f04bd4a79 don't write ":" when printing keybinding action with no argument 2024-01-22 21:01:16 -05:00
Mitchell Hashimoto
46dd6e6caf kitty graphics: assign automatic placement ID if p==0
Fixes #1356

As stated in the code, the specification itself doesn't explicitly
specify this behavior (as far as I can tell), but testing in Kitty
results in this working and I believe this is how they do it.
2024-01-22 15:51:51 -08:00
Mitchell Hashimoto
7c8b156960 kitty images: support pngs with greyscale/alpha (bpp=2)
Fixes #1355
2024-01-22 14:32:27 -08:00
LordMZTE
8182b69ae3 add increase_font_size keybind with plus 2024-01-22 16:15:03 +01:00
Aurélien Cibrario
509be969af Added plus + key 2024-01-21 21:09:24 -08:00
Mitchell Hashimoto
2c924be9b1 core: only dump scrollback contents if there is scrollback
Fixes #1353
2024-01-21 20:55:41 -08:00
Mitchell Hashimoto
23cd77884d Merge pull request #1350 from jcollie/keybind-docs
Generate help strings for keybind actions and use them in manpages and +list-keybinds.
2024-01-21 20:51:05 -08:00
Mitchell Hashimoto
3176ef86d9 cli: remove list-keybinds changes 2024-01-21 20:50:18 -08:00
Chris Marchesi
1b8b59538c Selection: don't alter x position when rectangle select is off viewport
This ensures that the start or end x values do not get adjusted when
they are off the viewport in rectangle select.

This also includes some tests for the toViewport method.

Fixes #1339.
2024-01-21 19:38:25 -08:00
Jeffrey C. Ollie
9b1f72987a markdown-ify keybind actions help strings 2024-01-21 19:50:39 -06:00
Jeffrey C. Ollie
65bf22af99 add keybind actions docs to manpages 2024-01-21 19:50:15 -06:00
Jeffrey C. Ollie
f41f70c977 Use keybind actions help strings in +list-keybinds. 2024-01-21 19:48:48 -06:00
Jeffrey C. Ollie
cab28c3940 Generate help strings for keybind actions. 2024-01-21 19:47:36 -06:00
Mitchell Hashimoto
4dbd10c913 apprt/embedded: support asking for selection text, existence 2024-01-21 17:22:44 -08:00
Mitchell Hashimoto
d96c2e7507 Merge pull request #1347 from jcollie/generate-manpages
Generate manpages (and other documentation) using help strings.
2024-01-21 14:58:03 -08:00
Mitchell Hashimoto
daac7943f3 mdgen stylistic changes 2024-01-21 14:53:34 -08:00
Mitchell Hashimoto
ba98aa3aeb build: shuffle files around for mdgen 2024-01-21 14:40:48 -08:00
Mitchell Hashimoto
0967fb46f8 build: use emit-docs for docs, don't need it on build config 2024-01-21 14:22:58 -08:00
Mitchell Hashimoto
5622ab370f renderer/metal,opengl: premult alpha for fragment shaders for images
Fixes #1346
2024-01-21 14:07:16 -08:00
Jeffrey C. Ollie
510f270c54 markdown-ify help strings 2024-01-21 15:07:37 -06:00
Jeffrey C. Ollie
ef09fa89b0 Generate documenation (manpages, etc.) from help strings. 2024-01-21 15:07:22 -06:00
Mitchell Hashimoto
628b54fbb5 Merge pull request #1344 from rockorager/reflow
reflow: respect wraparound mode when reflowing text
2024-01-21 09:12:18 -08:00
Mitchell Hashimoto
8b23d5c9ab terminal: handle wide character print at edge with wraparound disabled
Fixes #1343

If a wide character is found at the right edge of a terminal screen and
can't be printed without wrapping, the wide character is ignored. This
matches xterm behavior.

The one funky behavior is with grapheme clustering enabled and VS16
emoji. For VS16, we act as if VS16 was never received. This is not
specified in any way and no other terminal handles this correctly at the
time of authoring this so we're just making this up because it seems
most sensible.
2024-01-21 09:02:15 -08:00
Tim Culverhouse
6dcec75e32 reflow: add unit tests for wraparound mode
Add unit tests for resizing with wraparound on and off.
2024-01-21 07:02:06 -06:00
Tim Culverhouse
28732b950c reflow: respect wraparound mode when reflowing text
When calling resize, Ghostty should be respecting the wraparound state.
This behavior matches xterm. Note that this same bug was also found in
kitty.

Fixes: #1343
2024-01-21 06:43:22 -06:00
Mitchell Hashimoto
27453b64e6 cli/show-config: enable --help 2024-01-20 19:44:54 -08:00
Mitchell Hashimoto
ddd17eda06 cli: list-keybinds uses new config formatting API 2024-01-20 19:39:47 -08:00
Jeffrey C. Ollie
863c3933d3 use keybind struct's built-in capabity to format itself in +list-keybinds action 2024-01-20 19:38:12 -08:00
Mitchell Hashimoto
73a30ccd82 cli/show-config: add the changes-only and docs options 2024-01-20 19:37:48 -08:00
Jeffrey C. Ollie
de428d9fe9 add +show-config action to print out the config from the cli 2024-01-20 19:24:17 -08:00
Mitchell Hashimoto
64e3721bb7 config: formatter can output docs 2024-01-20 15:42:43 -08:00
Mitchell Hashimoto
daf297cee2 config: union type formatters 2024-01-20 15:35:16 -08:00
Mitchell Hashimoto
95a67e5f06 config: support only formatting changed fields 2024-01-20 15:24:17 -08:00
Mitchell Hashimoto
dbb808ae93 config: tests for formatEntry 2024-01-20 15:13:43 -08:00
Mitchell Hashimoto
2bf37843f3 config: tests for all custom formatEntry calls 2024-01-20 15:07:32 -08:00