1914 Commits

Author SHA1 Message Date
Mitchell Hashimoto
2c5271ca82 Merge pull request #397 from mitchellh/mrn/gtk-window-decoration
gtk: allow hiding window decoration in configuration
2023-09-03 12:41:14 -07:00
Thorsten Ball
a1a48eb3f0 gtk: allow hiding window decoration in configuration
This is part of #319 by fixing it for GTK and introducing the
configuration option.

This adds `window-decoration = false` as a possible configuration
option. If set to `false`, then no window decorations are used.
2023-09-03 21:27:21 +02:00
SoraTenshi
6faed268e0 config: clean up cursor style configuration 2023-09-03 07:51:36 -07:00
Mitchell Hashimoto
4570356e57 turn zoom into a toggle rather than an explicit zoom/unzoom 2023-09-02 16:03:51 -07:00
Mitchell Hashimoto
519a97b782 core: add unzoom_split binding 2023-09-02 15:15:12 -07:00
Mitchell Hashimoto
50a1a52ae3 core: add zoom keybinding for splits 2023-09-02 14:52:43 -07:00
Mitchell Hashimoto
d338828b85 Merge pull request #387 from mitchellh/dpi
content scale change events should also impact viewport padding
2023-09-02 13:58:06 -07:00
Mitchell Hashimoto
aa04c79586 terminal: CSI P must shift all remaining columns to right of cursor
Fixes #388
2023-09-02 11:28:37 -07:00
Mitchell Hashimoto
22eb533473 content scale change events should also impact viewport padding
This calculates the new padding pixel values and propogates those
changes to the renderer.
2023-09-02 11:00:51 -07:00
Mitchell Hashimoto
6c7ccae848 Merge pull request #385 from mgeist/update-font-dpi
Update font DPI when the content scale is updated
2023-09-02 10:41:07 -07:00
Mat
9e5ced2600 use a const scoped block for font size 2023-09-02 13:39:29 -04:00
Mat
0d094f244e Update font DPI when the content scale is updated 2023-09-02 13:00:04 -04:00
Will Pragnell
86122624e0 macos: add visible-menu non-native-fullscreen option 2023-09-01 21:45:45 -07:00
Mitchell Hashimoto
a6007cab7a terminal: fix unimplemented origin mode check 2023-09-01 08:46:53 -07:00
Mitchell Hashimoto
3bd77259bf font: don't use intCast on index
This is a weird one. By using intCast on the `idx` I am periodically
getting a panic on index out of bounds where the index is larger than
FontIndex can possibly be. Very strange!

I tried to just remove intCasts and believe it or not that worked.
Previously, `cat /dev/urandom` would trigger the issue in seconds and
now I've had it running 20+ minutes without the issue.

The additional `if` check is just a safety mechanism
2023-08-31 21:16:56 -07:00
Mitchell Hashimoto
36756cc866 terminal: charset table should be len 256, not 255 2023-08-31 20:45:13 -07:00
Mitchell Hashimoto
f4fef559fb terminal: delete lines outside of scroll region should do nothing 2023-08-31 20:41:32 -07:00
Mitchell Hashimoto
65246327dd terminal: add more assertions 2023-08-31 19:45:22 -07:00
Mitchell Hashimoto
6c13627d51 terminal: delete chars (CSI P) tested, fixes many issues 2023-08-31 19:42:23 -07:00
Mitchell Hashimoto
0aebf1e406 terminal: CSI S allows for count greater than scroll region height 2023-08-31 17:52:22 -07:00
Mitchell Hashimoto
d05381db83 remove some unreachables, log errors to avoid crashes
These are still TODO but we don't want to crash on bad input.
2023-08-31 14:55:27 -07:00
Mitchell Hashimoto
67bc9f59ed input: kitty keymap was missing page up/down 2023-08-31 14:32:42 -07:00
Mitchell Hashimoto
369ffebb72 input: when overwriting a binding, we must update the reverse map 2023-08-31 13:08:33 -07:00
Mitchell Hashimoto
60f8eca12d Merge pull request #368 from mitchellh/macos-sync
macos: sync keybindings with Mac menu items
2023-08-31 12:53:46 -07:00
Mitchell Hashimoto
fe5da86bb0 input: maintain a reverse mapping to quickly look up trigger by action 2023-08-31 12:45:43 -07:00
Will Pragnell
2e54ad2cce command: only spin on waitpid if it's non-blocking 2023-08-31 07:51:50 -07:00
Mitchell Hashimoto
ba883ce39a add ghostty_config_trigger C API to find a trigger for an action 2023-08-30 22:14:44 -07:00
Mitchell Hashimoto
c71979804e apprt/embedded: ghostty_surface_binding_action can now run any action 2023-08-30 21:46:38 -07:00
Mitchell Hashimoto
17e46bf0f4 input: move action parsing to dedicating Action.parse 2023-08-30 21:39:25 -07:00
Will Pragnell
aa9e12dac2 termio/exec: don't leak zombie subprocesses 2023-08-30 21:37:38 -07:00
Mitchell Hashimoto
3352cae3f7 terminal: resize more cols no longer preserves trailing stylized cells 2023-08-30 15:55:43 -07:00
Mitchell Hashimoto
c18527384e terminal: sgr parsing doesn't parse 4-form 48, allows unstyled underline
Fixes #362

We previously tried to parse 4-form 48, but as far as I can tell this is
never used anyways and in this real world scenario it expected us to
parse a 3-form followed by an underline. This fixes the real world
scenario as priority and adds a test.

This also fixes an issue where single form colon underline may actually
exist, again from a real world scenario.
2023-08-30 14:58:44 -07:00
Mitchell Hashimoto
fb2d4faa03 terminal: add contrast function based on w3c 2023-08-30 10:18:18 -07:00
Mitchell Hashimoto
0e8412ec19 terminal: add w3c luminance formula 2023-08-30 10:10:45 -07:00
Mitchell Hashimoto
3391908a82 terminal: get rid of duplicate RGB struct 2023-08-30 08:48:57 -07:00
Mitchell Hashimoto
e2fae7ab2b surface should default to default cursor, blinking should check selected 2023-08-30 08:12:38 -07:00
Mitchell Hashimoto
7e846bd367 terminal: tabstops were off by one
Fixes #359

See #359 for a test script. The unit tests were also wrong. I used the
test script in #359 to verify the exact column that tabstops should be
set at.
2023-08-29 20:18:54 -07:00
Mitchell Hashimoto
ed5c001690 font/shaper: split ligature around cell style change 2023-08-29 14:09:21 -07:00
Mitchell Hashimoto
ae0de7bce4 renderer: split ligature around cursor even if cursor is flashing
Fixes #356
2023-08-29 13:49:14 -07:00
Mitchell Hashimoto
4ed240515c font/sprite: fix horizontal dash drawing math for cells too small
Fixes #143

There were multiple issues with the previous calculation. First, we
expected dash width COULD be negative and protected against it, but our
dash width calculation type was unsigned! With the proper font metrics,
this led to an underflow safey panic.

Second, as part of the dash width calculation, we are tryign to downstep
the size of the gaps so we can try to fit dashes within a cell. But we
were not using those adjusted gap sizes. With the proper font metrics,
this could lead to an assertion failure seen in #143.

This fixes the calculations. They produce the same numbers, but do so in
a more Zig-idiomatic way while fixing the above two issues.
2023-08-29 11:25:49 -07:00
Mitchell Hashimoto
0204d94921 Merge pull request #349 from mitchellh/sync
Synchronized Output Sequence
2023-08-28 13:15:50 -07:00
Mitchell Hashimoto
0feac5d6cf termio/exec: disable synchronized output mode on resize 2023-08-28 11:43:28 -07:00
Mitchell Hashimoto
5168dc7645 renderer: do not render if synchronized output is on 2023-08-28 11:38:11 -07:00
Mitchell Hashimoto
2cc1e43716 termio: handle all the synchronized output setting, timer 2023-08-28 11:35:40 -07:00
Mitchell Hashimoto
91c2d6fcbd Merge pull request #348 from mitchellh/cc-term_program_env
Set TERM_PROGRAM and TERM_PROGRAM_VERSION environment variables
2023-08-28 11:34:08 -07:00
cryptocode
bdafd2dc8b Add comment explaining the purpose of the env variables 2023-08-28 20:25:44 +02:00
cryptocode
dfe21dcac4 Set TERM_PROGRAM and TERM_PROGRAM_VERSION environment variables.
WezTerm claims this is an emerging de-facto standard for terminal emulator identification:
a103b6d97a/config/src/config.rs (L1526-L1529)

One example of usage in the wild is neovim doing capability detection:
f050aaabbb/src/nvim/tui/tui.c (L206-L211)

Ghostty now reports this:

$echo $TERM_PROGRAM
ghostty

$echo $TERM_PROGRAM_VERSION
0.1.0-main+aa08f3c

I think it's really nice that the commit hash is included, as users can provide this in issue reports. WezTerm does the same.

I use these variables in my tui library in addition to $TERM and $COLORTERM for capability detection, which is what motivated this PR.
2023-08-28 20:16:46 +02:00
SoraTenshi
ead70eadae Add Caveat information for shell integration 2023-08-28 19:44:01 +02:00
SoraTenshi
fcf1537f82 config: Add option for custom cursor style 2023-08-28 18:20:45 +02:00
Mitchell Hashimoto
3b9d5d27ad terminal: implement DECRQM (request mode) 2023-08-28 08:50:11 -07:00