diff options
| author | user <user@clank> | 2026-08-14 12:13:18 +0200 |
|---|---|---|
| committer | user <user@clank> | 2026-08-14 12:13:18 +0200 |
| commit | 20f269a0cdf65f196aea09f0279f5927f26d8192 (patch) | |
| tree | cc0c10c3556b36d0234a64acf1a48da356a4a212 /src | |
| parent | sl0ptty: kitty graphics passthrough (diff) | |
| download | slosh-20f269a0cdf65f196aea09f0279f5927f26d8192.tar.gz slosh-20f269a0cdf65f196aea09f0279f5927f26d8192.tar.xz slosh-20f269a0cdf65f196aea09f0279f5927f26d8192.zip | |
sl0ppty: rename from sl0ptty
A pty is a pseudo-terminal, and that is what this multiplexes: the extra t
was never standing for anything. Renaming now, while the only users are the
people who typed the old name on purpose, is cheaper than renaming later.
Mechanical, but not only cosmetic. The name is also the runtime contract, so
this moves $SL0PTTY and $SL0PTTY_CONFIG, ~/.config/sl0ptty/config.kdl, the
socket directory ($XDG_RUNTIME_DIR/sl0ptty, /tmp/sl0ptty-<uid>), and the
identity string a program gets back from an OSC 5577 hello. A session left
running under the old binary keeps its old socket directory and is invisible
to the new one; there is no migration and it does not seem worth writing one.
The sl0ppi fork keeps its name: it is a different thing, and D1 still points
at it.
Diffstat (limited to 'src')
| -rw-r--r-- | src/app.c | 4 | ||||
| -rw-r--r-- | src/app.h | 8 | ||||
| -rw-r--r-- | src/client.c | 2 | ||||
| -rw-r--r-- | src/cmd.h | 6 | ||||
| -rw-r--r-- | src/config.c | 6 | ||||
| -rw-r--r-- | src/config.h | 10 | ||||
| -rw-r--r-- | src/graphics.h | 6 | ||||
| -rw-r--r-- | src/headless.c | 8 | ||||
| -rw-r--r-- | src/input.h | 6 | ||||
| -rw-r--r-- | src/json.h | 6 | ||||
| -rw-r--r-- | src/jsonval.h | 6 | ||||
| -rw-r--r-- | src/kdl.h | 6 | ||||
| -rw-r--r-- | src/main.c | 24 | ||||
| -rw-r--r-- | src/osc5577.h | 6 | ||||
| -rw-r--r-- | src/pane.c | 4 | ||||
| -rw-r--r-- | src/proto.c | 4 | ||||
| -rw-r--r-- | src/proto.h | 8 | ||||
| -rw-r--r-- | src/pty.c | 4 | ||||
| -rw-r--r-- | src/screen.c | 2 | ||||
| -rw-r--r-- | src/server.c | 6 | ||||
| -rw-r--r-- | src/server.h | 8 | ||||
| -rw-r--r-- | src/sl0ppty.h (renamed from src/sl0ptty.h) | 8 |
22 files changed, 74 insertions, 74 deletions
@@ -32,9 +32,9 @@ static void ensure_config(void) { /* A missing file is the normal case; a broken one is worth a line in the * log, and in both the compiled-in defaults stand (fail open). */ if (access(path, R_OK) == 0) - fprintf(stderr, "sl0ptty: %s: %s\n", path, err[0] ? err : "parse error"); + fprintf(stderr, "sl0ppty: %s: %s\n", path, err[0] ? err : "parse error"); } else if (err[0]) { - fprintf(stderr, "sl0ptty: %s: %s\n", path, err); + fprintf(stderr, "sl0ppty: %s: %s\n", path, err); } CFG_LOADED = true; } @@ -2,10 +2,10 @@ * * Both front ends (the interactive client and the headless driver) drive this * same object, so there is exactly one implementation of what a key does. */ -#ifndef SL0PTTY_APP_H -#define SL0PTTY_APP_H +#ifndef SL0PPTY_APP_H +#define SL0PPTY_APP_H -#include "sl0ptty.h" +#include "sl0ppty.h" typedef struct { uint16_t x, y, w, h; @@ -93,4 +93,4 @@ uint32_t app_current_tab_id(app_t *a); char *app_panes_json(app_t *a); char *app_tabs_json(app_t *a); -#endif /* SL0PTTY_APP_H */ +#endif /* SL0PPTY_APP_H */ diff --git a/src/client.c b/src/client.c index 03d5387..a3ad73d 100644 --- a/src/client.c +++ b/src/client.c @@ -75,7 +75,7 @@ int client_run(int fd) { term_size(&cols, &rows); if (tcgetattr(STDIN_FILENO, &g_saved) != 0) { - fprintf(stderr, "sl0ptty: not a terminal\n"); + fprintf(stderr, "sl0ppty: not a terminal\n"); return 1; } g_saved_ok = true; @@ -1,7 +1,7 @@ /* The command vocabulary, shared by the headless driver and the control * socket, so a script written against one works against the other. */ -#ifndef SL0PTTY_CMD_H -#define SL0PTTY_CMD_H +#ifndef SL0PPTY_CMD_H +#define SL0PPTY_CMD_H #include "app.h" @@ -10,4 +10,4 @@ char *cmd_exec(app_t *a, screen_t *s, input_parser_t *in, const char *line, bool *quit); -#endif /* SL0PTTY_CMD_H */ +#endif /* SL0PPTY_CMD_H */ diff --git a/src/config.c b/src/config.c index f173b2d..09d6e09 100644 --- a/src/config.c +++ b/src/config.c @@ -202,16 +202,16 @@ static action_t action_by_name(const char *name) { const char *config_default_path(void) { static char path[512]; - const char *explicit_ = getenv("SL0PTTY_CONFIG"); + const char *explicit_ = getenv("SL0PPTY_CONFIG"); if (explicit_ && *explicit_) { snprintf(path, sizeof path, "%s", explicit_); return path; } const char *xdg = getenv("XDG_CONFIG_HOME"); - if (xdg && *xdg) snprintf(path, sizeof path, "%s/sl0ptty/config.kdl", xdg); + if (xdg && *xdg) snprintf(path, sizeof path, "%s/sl0ppty/config.kdl", xdg); else { const char *home = getenv("HOME"); - snprintf(path, sizeof path, "%s/.config/sl0ptty/config.kdl", + snprintf(path, sizeof path, "%s/.config/sl0ppty/config.kdl", home ? home : "."); } return path; diff --git a/src/config.h b/src/config.h index ec89299..cee2203 100644 --- a/src/config.h +++ b/src/config.h @@ -4,14 +4,14 @@ * config file costs you a warning, never a terminal (the fail-open property * D9 asks of the CLI, applied to the mux itself). */ -#ifndef SL0PTTY_CONFIG_H -#define SL0PTTY_CONFIG_H +#ifndef SL0PPTY_CONFIG_H +#define SL0PPTY_CONFIG_H #include <stdbool.h> #include <stddef.h> #include <stdint.h> -#include "sl0ptty.h" +#include "sl0ppty.h" typedef enum { ACT_NONE = 0, @@ -81,7 +81,7 @@ typedef struct { * it keeps the defaults and writes the reason to `err`. */ void config_defaults(config_t *c); bool config_load(config_t *c, const char *path, char *err, size_t errcap); -/* $SL0PTTY_CONFIG, else $XDG_CONFIG_HOME/sl0ptty/config.kdl, else ~/.config/… */ +/* $SL0PPTY_CONFIG, else $XDG_CONFIG_HOME/sl0ppty/config.kdl, else ~/.config/… */ const char *config_default_path(void); void config_free(config_t *c); @@ -89,4 +89,4 @@ action_t config_lookup(const config_t *c, int key, uint16_t mods); /* "ctrl+a", "alt+left", "\\", "f" -> key + mods. False if unparseable. */ bool config_parse_chord(const char *text, int *out_key, uint16_t *out_mods); -#endif /* SL0PTTY_CONFIG_H */ +#endif /* SL0PPTY_CONFIG_H */ diff --git a/src/graphics.h b/src/graphics.h index 1a5572f..e31b733 100644 --- a/src/graphics.h +++ b/src/graphics.h @@ -8,8 +8,8 @@ * This is why pi has to fall back to sixel under tmux and zellij: they drop * the images entirely. Here the native path works. */ -#ifndef SL0PTTY_GRAPHICS_H -#define SL0PTTY_GRAPHICS_H +#ifndef SL0PPTY_GRAPHICS_H +#define SL0PPTY_GRAPHICS_H #include <stdbool.h> #include <stddef.h> @@ -59,4 +59,4 @@ void gfx_forget_pane(graphics_t *g, uint32_t pane); size_t gfx_placements(const graphics_t *g, const gfx_place_t **out); size_t gfx_images(const graphics_t *g, const gfx_image_t **out); -#endif /* SL0PTTY_GRAPHICS_H */ +#endif /* SL0PPTY_GRAPHICS_H */ diff --git a/src/headless.c b/src/headless.c index bceb579..dab817d 100644 --- a/src/headless.c +++ b/src/headless.c @@ -7,7 +7,7 @@ * `settle` is implemented here because it needs an event loop. */ #define _GNU_SOURCE -#include "sl0ptty.h" +#include "sl0ppty.h" #include <poll.h> #include <stdio.h> @@ -54,13 +54,13 @@ int run_headless(const char *const argv[], uint16_t cols, uint16_t rows, int idle_ms, bool script, const char *layout) { app_t *a = app_new(argv, cols, rows); if (!a) { - fprintf(stderr, "sl0ptty: cannot spawn pane\n"); + fprintf(stderr, "sl0ppty: cannot spawn pane\n"); return 1; } if (layout) { char err[256] = {0}; if (!app_apply_layout_file(a, layout, true, err, sizeof err)) - fprintf(stderr, "sl0ptty: %s: %s\n", layout, err[0] ? err : "bad layout"); + fprintf(stderr, "sl0ppty: %s: %s\n", layout, err[0] ? err : "bad layout"); } app_resize(a, cols, rows); screen_t s; @@ -93,7 +93,7 @@ int run_headless(const char *const argv[], uint16_t cols, uint16_t rows, char *reply = cmd_exec(a, &s, in, line, &quit); if (!reply) { - fprintf(stderr, "sl0ptty: unknown command: %s\n", line); + fprintf(stderr, "sl0ppty: unknown command: %s\n", line); continue; } /* Only commands that answer print a line, so the harness stays in step. */ diff --git a/src/input.h b/src/input.h index b92b2b0..e2fd7fe 100644 --- a/src/input.h +++ b/src/input.h @@ -8,8 +8,8 @@ * The event carries GhosttyKey / GHOSTTY_MODS_* values as plain integers so * this header stays free of libghostty-vt. */ -#ifndef SL0PTTY_INPUT_H -#define SL0PTTY_INPUT_H +#ifndef SL0PPTY_INPUT_H +#define SL0PPTY_INPUT_H #include <stdbool.h> #include <stddef.h> @@ -81,4 +81,4 @@ void input_timeout(input_parser_t *p, input_cb_t cb, void *ud); /* Debug/test rendering of an event, e.g. "key ARROW_UP mods=CTRL press". */ void input_event_describe(const input_event_t *ev, char *buf, size_t cap); -#endif /* SL0PTTY_INPUT_H */ +#endif /* SL0PPTY_INPUT_H */ @@ -1,6 +1,6 @@ /* A minimal JSON writer. No parser: we only ever emit. */ -#ifndef SL0PTTY_JSON_H -#define SL0PTTY_JSON_H +#ifndef SL0PPTY_JSON_H +#define SL0PPTY_JSON_H #include <stdbool.h> #include <stddef.h> @@ -25,4 +25,4 @@ void json_int(json_t *j, const char *key, long long val); void json_bool(json_t *j, const char *key, bool val); void json_null(json_t *j, const char *key); -#endif /* SL0PTTY_JSON_H */ +#endif /* SL0PPTY_JSON_H */ diff --git a/src/jsonval.h b/src/jsonval.h index 34cc597..53f1fe1 100644 --- a/src/jsonval.h +++ b/src/jsonval.h @@ -1,8 +1,8 @@ /* A small JSON reader, for the control API (D3). We already emit JSON; this * is the other half. Deliberately minimal: no streaming, no comments, no * duplicate-key policy beyond "last wins". */ -#ifndef SL0PTTY_JSONVAL_H -#define SL0PTTY_JSONVAL_H +#ifndef SL0PPTY_JSONVAL_H +#define SL0PPTY_JSONVAL_H #include <stdbool.h> #include <stddef.h> @@ -37,4 +37,4 @@ const char *jv_gets(const jv_t *obj, const char *key, const char *fallback); long jv_geti(const jv_t *obj, const char *key, long fallback); bool jv_getb(const jv_t *obj, const char *key, bool fallback); -#endif /* SL0PTTY_JSONVAL_H */ +#endif /* SL0PPTY_JSONVAL_H */ @@ -10,8 +10,8 @@ * Values are kept as strings and converted on read, which keeps the parser * small and puts type decisions where the meaning is. */ -#ifndef SL0PTTY_KDL_H -#define SL0PTTY_KDL_H +#ifndef SL0PPTY_KDL_H +#define SL0PPTY_KDL_H #include <stdbool.h> #include <stddef.h> @@ -46,4 +46,4 @@ const char *kdl_prop(const kdl_node_t *n, const char *key, const char *fallback) long kdl_prop_int(const kdl_node_t *n, const char *key, long fallback); bool kdl_prop_bool(const kdl_node_t *n, const char *key, bool fallback); -#endif /* SL0PTTY_KDL_H */ +#endif /* SL0PPTY_KDL_H */ @@ -1,15 +1,15 @@ /* Entry point and argument parsing. * - * sl0ptty attach to session "main", creating it if needed - * sl0ptty -s NAME ... a named session - * sl0ptty ls live sessions - * sl0ptty cmd LINE one control command against a session - * sl0ptty --server NAME run a session in the foreground (internal) - * sl0ptty --script the headless driver (no server, no tty) - * sl0ptty --headless run once, print the screen + * sl0ppty attach to session "main", creating it if needed + * sl0ppty -s NAME ... a named session + * sl0ppty ls live sessions + * sl0ppty cmd LINE one control command against a session + * sl0ppty --server NAME run a session in the foreground (internal) + * sl0ppty --script the headless driver (no server, no tty) + * sl0ppty --headless run once, print the screen */ #define _GNU_SOURCE -#include "sl0ptty.h" +#include "sl0ppty.h" #include <stdio.h> #include <stdlib.h> @@ -36,7 +36,7 @@ static void term_size(uint16_t *cols, uint16_t *rows) { } static void usage(void) { - fputs("usage: sl0ptty [-s NAME] [--layout FILE] [ls | cmd LINE | -- CMD...]\n", + fputs("usage: sl0ppty [-s NAME] [--layout FILE] [ls | cmd LINE | -- CMD...]\n", stderr); } @@ -70,7 +70,7 @@ int main(int argc, char **argv) { for (int j = i + 1; j < argc && cmd_n < 63; j++) cmd_argv[cmd_n++] = argv[j]; break; } else { - fprintf(stderr, "sl0ptty: unknown argument: %s\n", a); + fprintf(stderr, "sl0ppty: unknown argument: %s\n", a); usage(); return 2; } @@ -98,7 +98,7 @@ int main(int argc, char **argv) { if (cmd_line) { int fd = server_connect(name); if (fd < 0) { - fprintf(stderr, "sl0ptty: no session named %s\n", name); + fprintf(stderr, "sl0ppty: no session named %s\n", name); return 1; } return client_control(fd, cmd_line); @@ -113,7 +113,7 @@ int main(int argc, char **argv) { int fd = server_connect(name); if (fd < 0) fd = server_spawn(name, cmd_argv, cols, rows, layout); if (fd < 0) { - fprintf(stderr, "sl0ptty: cannot start session %s\n", name); + fprintf(stderr, "sl0ppty: cannot start session %s\n", name); return 1; } return client_run(fd); diff --git a/src/osc5577.h b/src/osc5577.h index 882fc06..7170c37 100644 --- a/src/osc5577.h +++ b/src/osc5577.h @@ -16,8 +16,8 @@ * discards an OSC it does not know — nothing is drawn, and we need no * buffering that could stall a pane's output. */ -#ifndef SL0PTTY_OSC5577_H -#define SL0PTTY_OSC5577_H +#ifndef SL0PPTY_OSC5577_H +#define SL0PPTY_OSC5577_H #include <stdbool.h> #include <stddef.h> @@ -46,4 +46,4 @@ size_t osc5577_unescape(const char *in, size_t in_len, char *out, size_t cap); * to defend against what a hostile label could smuggle through. */ bool osc5577_valid_id(const char *id); -#endif /* SL0PTTY_OSC5577_H */ +#endif /* SL0PPTY_OSC5577_H */ @@ -1,7 +1,7 @@ /* A pane: one pty, one libghostty-vt terminal, and the code that composites * its viewport into the screen. */ #define _GNU_SOURCE -#include "sl0ptty.h" +#include "sl0ppty.h" #include <errno.h> #include <stdio.h> @@ -116,7 +116,7 @@ static void on_osc5577(const char *verb, const char *payload, void *ud) { } else if (strcmp(verb, "hello") == 0) { /* Our addition to the fork's protocol, which is unversioned in practice: * a program can ask what it is talking to before using anything new. */ - const char *reply = "\033]5577;1;hello;sl0ptty;1\033\\"; + const char *reply = "\033]5577;1;hello;sl0ppty;1\033\\"; pane_write(p, reply, strlen(reply)); } else if (p->osc_cb) { p->osc_cb(p, verb, payload, p->osc_ud); /* purpose, and anything later */ diff --git a/src/proto.c b/src/proto.c index f0c318d..f714b91 100644 --- a/src/proto.c +++ b/src/proto.c @@ -94,8 +94,8 @@ int msg_send(int fd, uint8_t type, const void *data, size_t len) { static int session_dir(char *out, size_t cap) { const char *run = getenv("XDG_RUNTIME_DIR"); - if (run && *run) snprintf(out, cap, "%s/sl0ptty", run); - else snprintf(out, cap, "/tmp/sl0ptty-%u", (unsigned)getuid()); + if (run && *run) snprintf(out, cap, "%s/sl0ppty", run); + else snprintf(out, cap, "/tmp/sl0ppty-%u", (unsigned)getuid()); if (mkdir(out, 0700) != 0 && errno != EEXIST) return -1; return 0; } diff --git a/src/proto.h b/src/proto.h index dc3ea3a..ac68d44 100644 --- a/src/proto.h +++ b/src/proto.h @@ -4,8 +4,8 @@ * the interesting protocol is the JSON control channel (M3) that rides on * MSG_CMD, and it speaks the same vocabulary as the headless driver. */ -#ifndef SL0PTTY_PROTO_H -#define SL0PTTY_PROTO_H +#ifndef SL0PPTY_PROTO_H +#define SL0PPTY_PROTO_H #include <stdbool.h> #include <stddef.h> @@ -52,7 +52,7 @@ bool msg_reader_next(msg_reader_t *r, msg_t *out); /* Blocking send of one frame. Returns 0 on success, -1 if the peer is gone. */ int msg_send(int fd, uint8_t type, const void *data, size_t len); -/* $XDG_RUNTIME_DIR/sl0ptty/<name>.sock, or /tmp/sl0ptty-<uid>/<name>.sock. +/* $XDG_RUNTIME_DIR/sl0ppty/<name>.sock, or /tmp/sl0ppty-<uid>/<name>.sock. * Creates the directory (0700). Returns 0 on success. */ int session_socket_path(const char *name, char *out, size_t cap); int session_log_path(const char *name, char *out, size_t cap); @@ -60,4 +60,4 @@ int session_log_path(const char *name, char *out, size_t cap); * array. Returns the count. */ size_t session_list(char ***out_names); -#endif /* SL0PTTY_PROTO_H */ +#endif /* SL0PPTY_PROTO_H */ @@ -1,7 +1,7 @@ /* pty spawn. Hand-rolled rather than forkpty() so we need no libutil and * behave identically under musl. */ #define _GNU_SOURCE -#include "sl0ptty.h" +#include "sl0ppty.h" #include <errno.h> #include <fcntl.h> @@ -54,7 +54,7 @@ int pty_spawn(pty_t *p, const char *const argv[], uint16_t cols, uint16_t rows, /* We are opinionated about the outer terminal (D11), and we present the * same contract inward. xterm-ghostty is what libghostty-vt implements. */ setenv("TERM", "xterm-ghostty", 1); - setenv("SL0PTTY", "1", 1); + setenv("SL0PPTY", "1", 1); unsetenv("ZELLIJ"); signal(SIGPIPE, SIG_DFL); diff --git a/src/screen.c b/src/screen.c index ed7c343..b7175bb 100644 --- a/src/screen.c +++ b/src/screen.c @@ -1,7 +1,7 @@ /* The compositor: a cell buffer for the whole screen, and a diff that turns * two of them into the minimal byte stream for the real terminal. */ #define _GNU_SOURCE -#include "sl0ptty.h" +#include "sl0ppty.h" #include <stdarg.h> #include <stdio.h> diff --git a/src/server.c b/src/server.c index 17ce05a..b372821 100644 --- a/src/server.c +++ b/src/server.c @@ -40,7 +40,7 @@ static int64_t now_ms(void) { * by sending MSG_HELLO; anything else (a control command, a liveness probe * from `ls`) is just a connection and never displaces anybody. * - * This distinction is not fussiness. The zellij fork sl0ptty replaces had a + * This distinction is not fussiness. The zellij fork sl0ppty replaces had a * 20-25%% CLI failure rate because every action probed liveness by connecting, * that probe counted as a client, and its teardown removed the *real* one. */ #define MAX_CONNS 16 @@ -176,7 +176,7 @@ int server_run(const char *name, const char *const argv[], uint16_t cols, if (session_socket_path(name, path, sizeof path) != 0) return 1; int lfd = listen_socket(path); if (lfd < 0) { - fprintf(stderr, "sl0ptty: cannot listen on %s: %s\n", path, strerror(errno)); + fprintf(stderr, "sl0ppty: cannot listen on %s: %s\n", path, strerror(errno)); return 1; } @@ -192,7 +192,7 @@ int server_run(const char *name, const char *const argv[], uint16_t cols, if (layout) { char err[256] = {0}; if (!app_apply_layout_file(s.app, layout, true, err, sizeof err)) - fprintf(stderr, "sl0ptty: %s: %s\n", layout, err[0] ? err : "bad layout"); + fprintf(stderr, "sl0ppty: %s: %s\n", layout, err[0] ? err : "bad layout"); } app_resize(s.app, cols, rows); screen_init(&s.screen, cols, rows); diff --git a/src/server.h b/src/server.h index e2b9224..ac86e86 100644 --- a/src/server.h +++ b/src/server.h @@ -1,11 +1,11 @@ /* Server and client entry points. See proto.h for the wire. */ -#ifndef SL0PTTY_SERVER_H -#define SL0PTTY_SERVER_H +#ifndef SL0PPTY_SERVER_H +#define SL0PPTY_SERVER_H #include <stdbool.h> #include <stdint.h> -#include "sl0ptty.h" +#include "sl0ppty.h" /* Run the session in this process (the daemonised half). */ int server_run(const char *name, const char *const argv[], uint16_t cols, @@ -19,4 +19,4 @@ int server_connect(const char *name); int client_run(int fd); int client_control(int fd, const char *line); -#endif /* SL0PTTY_SERVER_H */ +#endif /* SL0PPTY_SERVER_H */ diff --git a/src/sl0ptty.h b/src/sl0ppty.h index 503eb48..955185c 100644 --- a/src/sl0ptty.h +++ b/src/sl0ppty.h @@ -1,6 +1,6 @@ -/* sl0ptty — common types. See DESIGN.md. */ -#ifndef SL0PTTY_H -#define SL0PTTY_H +/* sl0ppty — common types. See DESIGN.md. */ +#ifndef SL0PPTY_H +#define SL0PPTY_H #include <stdbool.h> #include <stddef.h> @@ -194,4 +194,4 @@ char *pane_selection_text(pane_t *p); void pane_compose(pane_t *p, screen_t *s, uint16_t x0, uint16_t y0, bool focused); -#endif /* SL0PTTY_H */ +#endif /* SL0PPTY_H */ |
