4063 Commits

Author SHA1 Message Date
Mitchell Hashimoto
542b416cf1 Merge pull request #1702 from jparise/force_shell
termio: fix "forced" shell integration
2024-04-20 20:49:55 -07:00
Mitchell Hashimoto
631ac651ab terminfo: for XTGETTCAP, non-parameterized string values return encoded
Fixes #1699

See #1699 for a lot more research. I haven't found a definitive source
of this behavior but this appears to match most of the mainstream
terminals and xterm for the realistic terminfo entries we have and
I'm going to consider that good enough.

For non-parameterized string values in a terminfo, the XTGETTCAP result
should be the tcap encoded form. This means replacing characters such as
`\E` with their byte form of 0x1B, and control characters such as `^H`
with their actual character 0x08, and so on.

"Non-parameterized" is a bit weird, the comment in this commit explains
my best guess (thanks to some community help) of why this may be.

This commit does NOT handle all encodings, but it handles the encodings
we use and the encodings I could cross-check with other terminals. The
actual tcap encoding is much more complicated and I'm sure for specific
types of terminfo values our encoding is not correct. If and when those
come up we should fix them.
2024-04-20 20:34:49 -07:00
Jon Parise
5ea99d3626 termio: fix "forced" shell integration
When a shell is forced, we would supply its /-prefixed executable name
to mimic a path location. The rest of the integration detection logic
assumes just a base executable name. Fix the forced names accordingly.

Also add a unit test for this "force shell" behavior.
2024-04-20 11:37:34 -07:00
Mitchell Hashimoto
be0d52a4f2 config: rename "wcswidth" to "legacy" for "grapheme-width-method"
We don't actually use libc wcswidth to determine width and even if we
did some terminals use wcwidth (which behaves differently), some use
the Python wcswidth library (which behaves differently), etc. The
reality is there is no real consistency on "legacy" behavior so by
naming it "legacy" we show that we're doing our best but also gives us
wiggle room to change our behavior in the future.

Functionally nothing changes with this commit.
2024-04-19 09:56:22 -07:00
Mitchell Hashimoto
93f8db59ce inspector: show cell codepoints and wide property 2024-04-19 09:33:43 -07:00
Mitchell Hashimoto
915e09367a Merge pull request #1696 from mitchellh/update-zig
Update to Latest Zig
2024-04-18 16:40:37 -07:00
Mitchell Hashimoto
cbd787c92d Merge pull request #1690 from TheOnlyMrCat/gtk_opacity
Fix background-opacity for the GTK backend
2024-04-18 15:04:56 -07:00
Mitchell Hashimoto
1f09da02ad terminal: relax cell zero value default test 2024-04-18 14:09:11 -07:00
Mitchell Hashimoto
bd7d71440e update zig, fix linux build 2024-04-18 13:27:15 -07:00
Max Guppy
2c8a1ada17 apprt/gtk: Fix background-opacity 2024-04-18 15:42:17 +10:00
Mitchell Hashimoto
8dbedeb76c fix breaking changes with latest zig 2024-04-17 20:50:50 -07:00
Mitchell Hashimoto
910c8cb04a terminal: another enum in a packed struct needs backing int 2024-04-17 20:50:50 -07:00
Mitchell Hashimoto
fc4284e406 input: Key.Side needs a specific backing int for use in packed 2024-04-17 20:50:50 -07:00
Mitchell Hashimoto
595f24585e working on more zig breaking changes 2024-04-17 20:50:50 -07:00
Mitchell Hashimoto
026484fea6 fix more comptime var leaks 2024-04-17 20:50:50 -07:00
Mitchell Hashimoto
5845281e30 update zig 2024-04-17 20:50:50 -07:00
Jon Parise
1087b9b0fd apprt/embedded: store userdata directly on Surface
We were previously retaining Options on the Surface struct, but other
than userdata, we only use those values for initialization. Instead,
store just the opaque userdata value on the Surface and clarify that
Surface.Options are only used for initialization.
2024-04-17 12:57:19 -07:00
Mitchell Hashimoto
acf823fe3a config: update docs that fullscreen is incompatible with win-deco
Fixes #1684
2024-04-16 09:13:57 -07:00
Mitchell Hashimoto
9ea78f981e terminal: index (LF) that scrolls scroll region preserves SGR
Fixes #1676

The comment in the diff explains. This is a regression that was not unit
tested properly in the old implementation prior to the paged-terminal
merge.
2024-04-13 21:31:41 -07:00
Mitchell Hashimoto
733ce19654 terminal: handle case where eraseRowBounded happens at top of page
Fixes #1677

If eraseRowBounded is called at the top of a page AND there is a tracked
pin at the top of the page, then we'd have an integer overflow. The test
case covers this and this adds a fix.
2024-04-13 20:45:39 -07:00
Mitchell Hashimoto
13d9c0159d font: SharedGridSet.Key needs to clone the DerivedConfig
Key contains pointers into DerivedConfig. Each surface has its own
DerivedConfig. This would cause memory corruption if the surface that
opened the initial font grid deallocates. Instead, let's make sure Key
owns its own DerivedConfig.
2024-04-11 13:04:23 -04:00
Mitchell Hashimoto
a1923c105c Merge pull request #1671 from mitchellh/font-dpi
font: SharedGridSet must hash diff for font size change
2024-04-09 08:50:52 -04:00
Mitchell Hashimoto
f67c2b70a7 font: SharedGridSet must hash diff for font size change
Fixes #1670

This fixes two issues:

  - If no font families are set, font points would not change the hash.
  - DPI changes would not change the hash.

When the hash doesn't change when it should, we reuse a font stack due
to changes in #1662. This would cause some font issues. :)
2024-04-09 08:45:01 -04:00
Mitchell Hashimoto
97a7c75437 Merge pull request #1669 from qwerasd205/fix-U+255D
font/sprite: Fix U+255D
2024-04-09 08:22:33 -04:00
Qwerasd
4b33f07b73 font/sprite: Fix U+255D
Double Up and Left '╝' previously had a hole in the bottom, extend line to fill gap.
2024-04-08 23:10:00 -04:00
Qwerasd
155a6d1114 font: fix discovery of styles
These are meant to be absolute indexes, make it so.
2024-04-08 20:44:17 -04:00
Mitchell Hashimoto
188d25b5d9 font/coretext: fix merge issue from #1662 2024-04-08 17:07:00 -04:00
Mitchell Hashimoto
e66e82787b Merge pull request #1662 from mitchellh/fontmem
Dedupe font stack for terminals with identical font configuration
2024-04-08 16:57:58 -04:00
Mitchell Hashimoto
b8410187c8 Merge pull request #1666 from mitchellh/ct-runs
font/coretext: shaper may return multiple runs and that's okay
2024-04-08 08:05:29 -07:00
Mitchell Hashimoto
edac4a113f font/coretext: shaper may return multiple runs and that's okay
Fixes #1664

I previously asserted that we got exactly one run from CoreText because
I assumed that our run iterator was perfectly splitting runs for
CoreText. This assumption appears to be false and that seems okay.

The test case in this commit produces two runs that are directly next to
each other and there's no downside to simply iterating over them. So
this commit changes to iterate over the runs.
2024-04-08 10:52:50 -04:00
rok
df9b8f1fbc input: fix bs emitting sequence when it should not
In korean input method on macos, it should simply return empty string.
Issue was created after https://github.com/mitchellh/ghostty/pull/1659.

```
gksr<BS> # 한ㄱ<BS>
```

'ㄱ' at the end should be removed with single <BS>, but for now
it requires two <bs> to remove 'ㄱ'.
2024-04-08 22:11:01 +09:00
Mitchell Hashimoto
21a648748d font: CodepointMap supports clone 2024-04-07 10:54:59 -07:00
Mitchell Hashimoto
06df9b7867 font: remove old files 2024-04-06 20:10:57 -07:00
Mitchell Hashimoto
e3402cef4d address many fontmem todos 2024-04-06 20:00:22 -07:00
Mitchell Hashimoto
3b0b9c2cfd renderer/opengl: set the font grid 2024-04-06 19:55:00 -07:00
Mitchell Hashimoto
2f61f7d6a3 font: fix hashing of descriptor strings 2024-04-06 19:49:14 -07:00
Mitchell Hashimoto
21605eaab7 apprt/embedded: setfontsize 2024-04-06 19:37:41 -07:00
Mitchell Hashimoto
84f30a6064 apprt/gtk: setFontsize should have error 2024-04-06 19:36:59 -07:00
Mitchell Hashimoto
3afeac99e9 renderer/opengl: support font size change 2024-04-06 19:35:56 -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
ebd31ad50f font: SharedGridSet DerivedConfig does not take font size 2024-04-06 10:45:44 -07:00
Mitchell Hashimoto
b9efd83798 font: SharedGridSet uses DerivedConfig 2024-04-06 10:37:26 -07:00
Mitchell Hashimoto
07a5dd0442 config: FontStyle.clone 2024-04-06 10:28:57 -07:00
Mitchell Hashimoto
efb8146c28 config: RepeatableString.clone should clone all the strings too 2024-04-06 10:20:16 -07:00
Mitchell Hashimoto
00f677fd51 font: SharedGridSet locks and is thread-safe 2024-04-06 10:08:52 -07:00
Mitchell Hashimoto
a22ca8e4c1 renderer/opengl: clean up texture sync 2024-04-06 09:34:34 -07:00
Mitchell Hashimoto
45f518851d renderer/opengl: convert to SharedGrid, new windows/tabs are frozen 2024-04-05 22:00:51 -07:00
Mitchell Hashimoto
b77513de1a font/harfbuzz: work with new font structures 2024-04-05 21:48:53 -07:00