275 Commits

Author SHA1 Message Date
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
2cc1e43716 termio: handle all the synchronized output setting, timer 2023-08-28 11:35:40 -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
Mitchell Hashimoto
3b9d5d27ad terminal: implement DECRQM (request mode) 2023-08-28 08:50:11 -07:00
Mitchell Hashimoto
f2f2b1eaf1 termio/exec: initial subprocess screen size should be sub padding 2023-08-24 08:45:32 -07:00
Mitchell Hashimoto
ec5dcf0850 terminal/kitty-gfx: do not send response on transmit/display unless I 2023-08-23 22:37:01 -07:00
Mitchell Hashimoto
46ba3189f6 config: image-storage-limit to set maximum image memory per terminal 2023-08-23 16:58:16 -07:00
Mitchell Hashimoto
71f1f35cfc terminal/kitty-gfx: move cursor after image placement 2023-08-22 12:15:51 -07:00
Mitchell Hashimoto
660faf3ac3 terminal: clear screen, alt screen, etc. clear all kitty graphics 2023-08-21 15:34:46 -07:00
Mitchell Hashimoto
b2432a672f terminal/kitty-gfx: add debug function to dump image data 2023-08-21 08:28:20 -07:00
Mitchell Hashimoto
bbcb2f96c8 terminal/kitty-gfx: huge progress on chunked transfers, lots of issues 2023-08-20 22:03:21 -07:00
Mitchell Hashimoto
80c7f09a36 terminal/kitty-gfx: start terminal state, can load and add images 2023-08-20 22:03:21 -07:00
Mitchell Hashimoto
c7658df978 terminal/kitty-gfx: support "query", loading images, tests 2023-08-20 22:03:20 -07:00
Mitchell Hashimoto
824d586afc terminal: generalized APC handler 2023-08-20 22:03:20 -07:00
Mitchell Hashimoto
bddf8a8cb3 termio/exec: limit max apc string length 2023-08-20 22:03:19 -07:00
Mitchell Hashimoto
6e061fb344 termio/exec: process APC callbacks 2023-08-20 22:03:19 -07:00
Mitchell Hashimoto
3ca759bac6 core: send pixel-level surface sizing to the pty 2023-08-20 22:03:19 -07:00
Mitchell Hashimoto
e7ab16f0e1 terminal: CSI < u defaults param to "1" if not set (pop kitty keyboard) 2023-08-20 22:02:12 -07:00
Mitchell Hashimoto
fe1e879ec7 termio: disable kitty keyboard protocol for glfw
See comment.
2023-08-17 15:08:39 -07:00
Mitchell Hashimoto
af4ede40f1 terminal: implement CSI = u for setting kitty keyboard flags 2023-08-16 17:31:05 -07:00
Mitchell Hashimoto
a9d7e0eb7f terminal: parse kitty query, push, pop keyboard flags 2023-08-16 17:31:05 -07:00
Mitchell Hashimoto
d0bf6a914f termio: on restore mode we need to call setMode no matter what 2023-08-15 11:47:31 -07:00
Mitchell Hashimoto
06f82ad713 terminal: parse and handle save/restore mode (CSI ? s, CSI ? r) 2023-08-15 11:43:07 -07:00
Mitchell Hashimoto
951aa00c63 terminal: move to new modes struct 2023-08-15 11:30:33 -07:00
Mitchell Hashimoto
d27bc1f0fe termio: send VT220 device attributes on request, add secondary 2023-08-15 08:21:48 -07:00
Mitchell Hashimoto
4a384aa272 parse and respect mode 1036 2023-08-13 15:12:13 -07:00
Mitchell Hashimoto
66aa1d9be3 terminal: parse and handle set modify key format (ESC[>{a};{b}m) 2023-08-13 14:55:32 -07:00
Mitchell Hashimoto
d94474463b terminal: handle set application keypad mode (both ESC and modes) 2023-08-13 14:55:32 -07:00
Mitchell Hashimoto
f3996ff0f8 apprt: primary clipboard awareness (selection clipboard) 2023-08-09 13:41:22 -07:00
Mitchell Hashimoto
e33f6c71de update libxev to fix split writes on large writes (i.e. big paste)
Fixes #258

This was an upstream bug in libxev where partial the queueWrite
mechanism would not correctly handle partial write results:
https://github.com/mitchellh/libxev/pull/60
2023-08-09 08:18:43 -07:00
Mitchell Hashimoto
a8380e937d scroll top, bot, page up, page down binding actions 2023-08-09 07:24:11 -07:00
Mitchell Hashimoto
6b45d931c3 plumb through the resources dir to termio 2023-08-08 09:29:38 -07:00
Mitchell Hashimoto
c0f5c0ef41 termio/exec: poll() needs a negative timeout to block 🤡 2023-08-08 09:14:08 -07:00
Mitchell Hashimoto
e2e876bfa1 termio/exec: make sure that process is dead before killing read thread 2023-08-07 21:13:33 -07:00
Mitchell Hashimoto
b5bb3b3739 termio/exec: if read thread gets 0 bytes then break the tight loop 2023-08-07 21:10:11 -07:00
Mitchell Hashimoto
816cad07b9 termio/exec: set pty fd to non-blocking, try to read as long as possible 2023-08-07 20:55:01 -07:00
Mitchell Hashimoto
f40a90e7aa termio: use a pipe to notify the reader thread to quit
Simultaneously reading and closing a fd is UB. We need to ensure that we
quit, then close.
2023-08-07 20:41:34 -07:00
Mitchell Hashimoto
23935c3563 change sentinel value for resources dir, its different on Linux 2023-08-07 16:16:44 -07:00
Mitchell Hashimoto
ebbf42eec6 search for resources dir relative to executing binary on Linux (#245)
* search for resources dir relative to executing binary on Linux

From Andrew in #241:

This works in all 3 of the possible scenarios I can think of on Linux:
 * `zig build` with default prefix into `zig-out`
 * `zig build -p ~/local` (my choice when compiling from source)
 * ghostty packaged for a linux distribution into /usr/bin and /share

* update README
2023-08-07 16:08:27 -07:00
Mitchell Hashimoto
5c6d3c7df2 terminal: implement insert mode (mode = 4) 2023-08-07 07:44:13 -07:00
Mitchell Hashimoto
85e32f9a15 renderer: hide cursor is state explicit asks for invisible cursor
This was a regression. The previous logic would always show the cursor
if we were using a non-blinking cursor. But, if the terminal state is
explicitly requesting an invisible cursor (mode 25) then we need to hide
the cursor.
2023-08-06 09:55:13 -07:00
Mitchell Hashimoto
321be2d5ad termio: respect GHOSTTY_RESOURCES_DIR 2023-08-05 21:38:32 -07:00
Mitchell Hashimoto
fb2f635c91 termio/exec: default window title to the pwd if not reported
We rely on the shell to report the window title. If the shell doesn't
report the window title then we default to the pwd.
2023-08-04 11:07:59 -07:00
Mitchell Hashimoto
02d0619f87 change "auto" to "detect" for shell integration 2023-07-06 18:05:01 -07:00
Mitchell Hashimoto
8239f09d9d allow configuring shell integration injection 2023-07-06 18:04:12 -07:00
Mitchell Hashimoto
ad62e3ac1b fish shell integration 2023-07-06 16:10:30 -07:00
Mitchell Hashimoto
ae206b2f89 termio: fish shell integration injection 2023-07-06 14:14:55 -07:00
Mitchell Hashimoto
59fb3a55e3 termio/exec: refactor resources dir lookup to prep for shell integ 2023-07-06 13:42:06 -07:00