aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authoruser <user@clank>2026-09-02 16:24:41 +0200
committeruser <user@clank>2026-09-02 16:24:41 +0200
commitc58a875ef3bcb464cdbea72bdbd0a874b6f93729 (patch)
treef2000cae2b8ca1f110f344080dde1d70114b15ea /include
parentslosh --install-terminfo: the binary carries its own terminfo entry (diff)
downloadslosh-c58a875ef3bcb464cdbea72bdbd0a874b6f93729.tar.gz
slosh-c58a875ef3bcb464cdbea72bdbd0a874b6f93729.tar.xz
slosh-c58a875ef3bcb464cdbea72bdbd0a874b6f93729.zip
pty: install the terminfo entry implicitly when it is missing everywhere
The lookup miss now writes the embedded entry to ~/.terminfo and uses it, so a bare box gets the full TERM with no step at all. An entry that exists anywhere is respected -- possibly newer, certainly somebody's -- and a HOME that cannot be written leaves the xterm-256color fallback standing. --install-terminfo stays as the by-hand spelling; the writer moved to pty.c where the panes are.
Diffstat (limited to 'include')
-rw-r--r--include/slosh.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/slosh.h b/include/slosh.h
index 75aa658..47d8220 100644
--- a/include/slosh.h
+++ b/include/slosh.h
@@ -162,6 +162,10 @@ typedef struct {
/* `cell_w`/`cell_h` are the client's cell size in pixels, so the pty's
* winsize carries real pixel dimensions: a program that draws images asks the
* tty how big a cell is, and zeroes there mean it cannot size one. */
+/* Write the embedded xterm-ghostty terminfo into ~/.terminfo (0 on
+ * success). Panes do this on their own when the entry is missing
+ * everywhere; `slosh --install-terminfo` is the by-hand spelling. */
+int pty_terminfo_install(void);
int pty_spawn(pty_t *p, const char *const argv[], uint16_t cols, uint16_t rows,
const char *cwd, uint16_t cell_w, uint16_t cell_h);
int pty_resize(pty_t *p, uint16_t cols, uint16_t rows, uint16_t cell_w,