2806 Commits

Author SHA1 Message Date
Mitchell Hashimoto
d287e741b1 apprt/embedded: initialize unmodified keystate prior to use
Fixes #521

We were not initializing the dead key state. The dead key state is read
on all translation calls so it must be initialized to 0. This was
working before because coincidentally whatever the memory was always
worked (it probably didn't, but it never didn't work for someone to
notice).

In debug modes, Zig sets uninitialized memory to 0xAAAAAAAA. Amusingly,
this is a valid dead key state value that UCKeyTranslate ignores and
thus produces the correct value. Therefore, we were only seeing bugs in
release modes where the uninitialized memory was a bad value
(consistently 0x1 on my machine) causing the wrong key to come out.

We were getting lucky before, this has always been a bug.
2023-09-22 09:18:52 -07:00
Mitchell Hashimoto
4a774b088b Merge pull request #516 from rockorager/Smulx
terminfo: add Smulx (underline styles) entry
2023-09-21 14:50:28 -07:00
Tim Culverhouse
e70e763e8c terminfo: add Smulx (underline styles) entry
Add a terminfo entry for Smulx, which advertises support for curly,
dashed, dotted, etc underlines

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
2023-09-21 16:47:10 -05:00
Mitchell Hashimoto
26c9f1325e Merge pull request #515 from mitchellh/update-zig
update zig to 0.12.0-dev.464+a63a1c5cb
2023-09-21 11:26:48 -07:00
Mitchell Hashimoto
e644be3b25 update zig to 0.12.0-dev.464+a63a1c5cb 2023-09-21 11:03:34 -07:00
Mitchell Hashimoto
ec7ab5b6a4 apprt/gtk: always set app ID, use G_APPLICATION_NON_UNIQUE instead
This makes the icon and title work on Wayland while retaining the
gtk-single-instance functionality.
2023-09-21 10:57:10 -07:00
Mitchell Hashimoto
2889271ee0 Merge pull request #507 from rockorager/osc_utf8
osc: allow 0x20-0xFF in osc_put
2023-09-21 09:58:51 -07:00
Mitchell Hashimoto
680478ed88 Merge pull request #513 from mitchellh/macos-mouse
macos: multiple mouse-hide-while-typing fixes
2023-09-21 09:50:15 -07:00
Mitchell Hashimoto
7f549c5b41 macos: detect mouseEntered/Exit on frame change 2023-09-21 09:42:17 -07:00
Mitchell Hashimoto
d12f07ceda macos: mouse tracking area should always send
Without this, non-first-responder views would not receive mouse
entered/exit events. This would break some of our mouse hiding state.
See comments for more info.
2023-09-21 09:30:42 -07:00
Mitchell Hashimoto
ea16fcf255 Merge pull request #512 from mitchellh/mouse-report
core: send proper reporting code for alt not super
2023-09-21 08:59:14 -07:00
Mitchell Hashimoto
b7055e2026 core: send proper reporting code for alt not super 2023-09-21 08:49:14 -07:00
Mitchell Hashimoto
44c90d02c4 Merge pull request #509 from mitchellh/csi-e-f
terminal: CSI E and F
2023-09-21 08:38:54 -07:00
Mitchell Hashimoto
92e98d34b5 terminal: CSI E and F 2023-09-21 08:21:32 -07:00
Mitchell Hashimoto
9af51a71e4 Merge pull request #506 from rockorager/xtversion
terminal: use larger buffer for xtversion response
2023-09-21 06:53:20 -07:00
Tim Culverhouse
5e800df277 osc: allow 0x20-0xFF in osc_put
The osc_string state of the parser limited accepted bytes to 0x7F. When
parsing a utf-8 encoded string as part of an OSC string, the parser
would encounter an error and abort the OSC parsing, allowing any
remaining bytes to be leaked (possibly) as printable characters to the
terminal window.

Allow any byte in the range 0x20 - 0xFF to be accepted by osc_put. Add
test cases which conflict with the 'anywhere' transitions (IE the utf8
sequence includes C1 control codes which might transition to another
state).
2023-09-21 03:08:41 -05:00
Tim Culverhouse
2d769b03ae terminal: use larger buffer for xtversion response
Commit fbe030d85a80 ("terminal: respond to XTVERSION query") introduced
responding to XTVERSION queries. The implementation uses the
.write_small method, which has a limit of 38 bytes. This works well if
your branch is named "main", since the branch is part of the
version_string variable. If you start using longer branch names, you can
quickly run into the limit.

The XTVERSION response is:

  "\x1bP>|ghostty d.d.d-<branch>+<12-digit-hash>\x07"

Which has an overhead of 32 bytes, meaning the natural branch limit is 6
bytes (6 characters, assuming you use ASCII branch names). Github has a
limit of 256 chars, so let's set a max XTVERSION buffer of 256+32 = 288

Fixes: fbe030d85a80 ("terminal: respond to XTVERSION query")
2023-09-21 03:04:23 -05:00
Mitchell Hashimoto
bf6ff079d4 Merge pull request #504 from mitchellh/macos-appearance
macos: window-theme setting to force light or dark theme
2023-09-20 22:14:26 -07:00
Mitchell Hashimoto
960edee559 macos: background-opacity getter 2023-09-20 22:05:23 -07:00
Mitchell Hashimoto
3ad39dd5e4 macos: sync NSAppearance for app based on window-theme setting 2023-09-20 21:54:50 -07:00
Mitchell Hashimoto
8963c3b299 config: window-theme, enum support for get 2023-09-20 21:30:57 -07:00
Mitchell Hashimoto
62dad04f0c Merge pull request #502 from rockorager/xtversion
terminal: respond to XTVERSION query
2023-09-20 17:22:24 -07:00
Tim Culverhouse
fbe030d85a terminal: respond to XTVERSION query
XTVERSION (CSI > 0 q) is used by some libraries to identify the terminal
+ version. Respond to this query with `ghostty {version_string}`. There
is no formal format for this response. A roundup of a few tested
terminals show two primary formats. This patch opts to save one byte and
use the `name SP version` semantics.

foot: foot(version)
xterm: XTerm(version)
contour: contour version
wezterm: wezterm version

Reference: https://github.com/dankamongmen/notcurses/blob/master/TERMINALS.md#notes-for-terminal-authors
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
2023-09-20 19:06:28 -05:00
Mitchell Hashimoto
0dd7d37d22 Merge pull request #501 from mitchellh/fkeys
input: correct xterm encoding for modified F1-F4
2023-09-20 14:43:08 -07:00
Mitchell Hashimoto
9ad27924a6 input: correct xterm encoding for modified F1-F4
Fixes #499
2023-09-20 14:33:55 -07:00
Mitchell Hashimoto
59267c4c4d termio/exec: remove GHOSTTY_MAC_APP on Mac 2023-09-20 14:25:48 -07:00
Mitchell Hashimoto
afda62048b Merge pull request #500 from mitchellh/macos-cli
macos: Ghostty binary is also a CLI app
2023-09-20 13:40:26 -07:00
Mitchell Hashimoto
ea4bc95f43 os: appendEnv 2023-09-20 13:02:06 -07:00
Mitchell Hashimoto
bd528f5c11 macos: set the proper env var 2023-09-20 12:43:35 -07:00
Mitchell Hashimoto
718c8d7ac8 main: disable stderr logging by default for lib 2023-09-20 12:38:26 -07:00
Mitchell Hashimoto
7059b4f74d apprt/embedded: ghostty_cli_main 2023-09-20 12:35:52 -07:00
Mitchell Hashimoto
cdbf16e13b macos: set env var for app bundle to detect app launch vs CLI 2023-09-20 11:10:46 -07:00
Mitchell Hashimoto
423e55ce0f macos: change executale name to "ghostty" (lowercase)
This way we can also put this on the PATH and use it as a CLI...
2023-09-20 10:13:12 -07:00
Mitchell Hashimoto
6cee9e57f6 macos: prevent mouseEntered/Exited processing if already in that state
See the comment in the code.

Fixes #494
2023-09-20 08:53:31 -07:00
Mitchell Hashimoto
ca20bda3e9 Merge pull request #493 from mitchellh/gtk-keyvals
apprt/gtk: use gtk_keyval_to_lower to get unshifted
2023-09-19 17:54:26 -07:00
Mitchell Hashimoto
1f7d567f29 apprt/gtk: use gtk_keyval_to_lower to get unshifted
map_keycode was not respecting the keyboard layout!
2023-09-19 17:44:18 -07:00
Mitchell Hashimoto
ff74f27b99 macos: send caps lock state to UCKeyTranslate 2023-09-19 15:42:36 -07:00
Mitchell Hashimoto
4b0bb2048c Merge pull request #492 from mitchellh/kitty
input: kitty alternates and text should not include control characters
2023-09-19 15:19:41 -07:00
Mitchell Hashimoto
62a35417ab input: kitty alternates and text should not include control characters 2023-09-19 15:18:00 -07:00
Mitchell Hashimoto
3de3aa8c78 Merge pull request #490 from mitchellh/clipboard-request
Async clipboard read
2023-09-19 11:17:25 -07:00
Mitchell Hashimoto
7748390a7e apprt/gtk: async clipboard 2023-09-19 10:53:45 -07:00
Mitchell Hashimoto
5a02635d2c macos: async style clipboard reading 2023-09-19 10:36:17 -07:00
Mitchell Hashimoto
b30feeb596 core: move clipboard to async process 2023-09-19 10:18:17 -07:00
Mitchell Hashimoto
852249664b update README 2023-09-18 22:34:54 -07:00
Mitchell Hashimoto
371ec88768 update README 2023-09-18 22:33:20 -07:00
Mitchell Hashimoto
37537bc891 update README for Linux installation notes 2023-09-18 22:31:19 -07:00
Mitchell Hashimoto
dc1757160b Merge pull request #488 from mitchellh/csi-g-wrap
terminal: CSI G must reset pending wrap state
2023-09-18 22:18:47 -07:00
Mitchell Hashimoto
eeba3057f9 terminal: CSI G must reset pending wrap state
Fixes #479
2023-09-18 22:14:04 -07:00
Mitchell Hashimoto
063a66ea6c terminal: allow mixed semicolon/colon CSI m commands
Fixes #487
2023-09-18 21:45:19 -07:00
Mitchell Hashimoto
02b76e5a9b Merge pull request #486 from mitchellh/gtk-app-window
gtk: Menu, Header Buttons, About Window
2023-09-18 15:56:05 -07:00