diff options
| author | user <user@clank> | 2026-08-18 21:26:00 +0200 |
|---|---|---|
| committer | user <user@clank> | 2026-08-18 21:26:00 +0200 |
| commit | b9e53cace4eb75263077df8623b011e66f5f2241 (patch) | |
| tree | 78e4dfb23f5d1881dc7bfe9e4c96fd543bdfab0b /src | |
| parent | sl0ppty: aim the top handle at the middle, and stop ruling through the row (diff) | |
| download | slosh-b9e53cace4eb75263077df8623b011e66f5f2241.tar.gz slosh-b9e53cace4eb75263077df8623b011e66f5f2241.tar.xz slosh-b9e53cace4eb75263077df8623b011e66f5f2241.zip | |
slosh: rename the project from sl0ppty
sl0p + pty was error-prone to type and the zero made it worse; slosh
(slop + sh) is one syllable, impossible to typo, and slosh.foo is ours.
Mechanical rename everywhere it appears: binary, env vars (SLOSH,
SLOSH_SESSION, SLOSH_BIN, SLOSH_CONFIG), socket dir (/tmp/slosh-<uid>,
$XDG_RUNTIME_DIR/slosh), config path (~/.config/slosh), header guards,
src/sl0ppty.h -> src/slosh.h, contrib/sl0ppty-dev -> contrib/slosh-dev,
the driving-slosh skill, docs and tests. The sl0ppi fork references and
the sl0p theme stay: one is history, the other is the brand.
The rename surfaced a latent bug in test_osc5577: the hello-reply
answer always appeared on screen twice (ECHOCTL echo plus cat -v), but
a seven-character implementation name happened to wrap the second copy
across the 60-column boundary, so counting substrings in wrapped text
found one and passed for the wrong reason. A five-character name moved
the wrap and exposed it. The loop guard itself is correct -- with echo
off before the request there is exactly one reply -- so the test now
counts on de-wrapped text and tolerates the pane's own echo.
Diffstat (limited to 'src')
| -rw-r--r-- | src/app.c | 12 | ||||
| -rw-r--r-- | src/app.h | 10 | ||||
| -rw-r--r-- | src/client.c | 2 | ||||
| -rw-r--r-- | src/cmd.h | 6 | ||||
| -rw-r--r-- | src/config.c | 19 | ||||
| -rw-r--r-- | src/config.h | 14 | ||||
| -rw-r--r-- | src/expr.h | 6 | ||||
| -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 | 34 | ||||
| -rw-r--r-- | src/osc5577.h | 6 | ||||
| -rw-r--r-- | src/pane.c | 4 | ||||
| -rw-r--r-- | src/path.c | 2 | ||||
| -rw-r--r-- | src/png.h | 6 | ||||
| -rw-r--r-- | src/project.c | 2 | ||||
| -rw-r--r-- | src/project.h | 8 | ||||
| -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 | 23 | ||||
| -rw-r--r-- | src/server.h | 8 | ||||
| -rw-r--r-- | src/shader.c | 8 | ||||
| -rw-r--r-- | src/shader.h | 8 | ||||
| -rw-r--r-- | src/shader_abi.h | 26 | ||||
| -rw-r--r-- | src/slosh.h (renamed from src/sl0ppty.h) | 8 |
30 files changed, 133 insertions, 135 deletions
@@ -43,12 +43,12 @@ 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, "sl0ppty: %s: %s\n", path, err[0] ? err : "parse error"); + fprintf(stderr, "slosh: %s: %s\n", path, err[0] ? err : "parse error"); snprintf(CFG_COMPLAINT, sizeof CFG_COMPLAINT, "%s", err[0] ? err : "config parse error"); } } else if (err[0]) { - fprintf(stderr, "sl0ppty: %s: %s\n", path, err); + fprintf(stderr, "slosh: %s: %s\n", path, err); snprintf(CFG_COMPLAINT, sizeof CFG_COMPLAINT, "%s", err); } CFG_LOADED = true; @@ -821,7 +821,7 @@ static void draw_status_line(app_t *a, screen_t *s) { if (n) screen_text(s, x, y, line, STATUS_C, NO_COLOR, 0); /* What goes between the two ends: the hint for whatever the pointer is on, - * and when there is none, which sl0ppty this is. The hint wins because it is + * and when there is none, which slosh this is. The hint wins because it is * about right now and the banner is about always; the banner takes the slot * back the moment the pointer moves off, which is most of the time. * @@ -843,7 +843,7 @@ static void draw_status_line(app_t *a, screen_t *s) { if (!middle && CFG.version_banner) { /* Quieter than a hint: this is ambient, and a hint is an answer to * something you are doing. */ - middle = "sl0ppty " SL0PPTY_VERSION; + middle = "slosh " SLOSH_VERSION; middle_fg = STATUS_C; } if (!middle) return; @@ -2932,7 +2932,7 @@ bool app_workspace_save(app_t *a, uint32_t tab, const char *path, int suspend, * timestamp, for the same reason the dump has none: a file that differs every * time is a bad diff, and this one is meant to be committed. */ fputs("// What this project needs open, written by `save-workspace`.\n" - "// Checked by `sl0ppty --check`; opened by `open-workspace`.\n", + "// Checked by `slosh --check`; opened by `open-workspace`.\n", f); fputs(kdl, f); bool wrote = fclose(f) == 0; @@ -6671,7 +6671,7 @@ void app_event(app_t *a, const input_event_t *ev) { * * The inverse of apply-layout, and the thing that makes a restart survivable: * build a fresh binary, dump what you have, quit, come back with `--layout`. - * contrib/sl0ppty-dev wraps exactly that. + * contrib/slosh-dev wraps exactly that. * * What can honestly be restored is the *shape*: tabs, their names and * purposes, how the panes are split, in what proportion, in which directory, @@ -2,13 +2,13 @@ * * 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 SL0PPTY_APP_H -#define SL0PPTY_APP_H +#ifndef SLOSH_APP_H +#define SLOSH_APP_H #include "kdl.h" #include "project.h" #include "shader.h" -#include "sl0ppty.h" +#include "slosh.h" typedef enum { SPLIT_COLS, SPLIT_ROWS } split_dir_t; @@ -174,7 +174,7 @@ typedef struct { } app_workspace_save_t; /* Write one tab out as a project's layout: the same dump `dump-layout` answers - * with, relative to the project, into `sl0ppty.layout.kdl` beside it. `tab` 0 is + * with, relative to the project, into `slosh.layout.kdl` beside it. `tab` 0 is * the current one; `path` names the project for a tab that is not yet a * workspace (and saving adopts it, which is the whole of onboarding one). * Refused without `force` when the project already has a layout: that file is @@ -319,4 +319,4 @@ char *app_dump_layout(app_t *a, dump_layout_t *o); char *app_panes_json(app_t *a); char *app_tabs_json(app_t *a); -#endif /* SL0PPTY_APP_H */ +#endif /* SLOSH_APP_H */ diff --git a/src/client.c b/src/client.c index b1155b8..e826164 100644 --- a/src/client.c +++ b/src/client.c @@ -89,7 +89,7 @@ int client_run(int fd) { term_size(&cols, &rows, &cell_w, &cell_h); if (tcgetattr(STDIN_FILENO, &g_saved) != 0) { - fprintf(stderr, "sl0ppty: not a terminal\n"); + fprintf(stderr, "slosh: 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 SL0PPTY_CMD_H -#define SL0PPTY_CMD_H +#ifndef SLOSH_CMD_H +#define SLOSH_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 /* SL0PPTY_CMD_H */ +#endif /* SLOSH_CMD_H */ diff --git a/src/config.c b/src/config.c index 4958883..48622b2 100644 --- a/src/config.c +++ b/src/config.c @@ -1324,9 +1324,9 @@ static void cb_chain(cfgbuf_t *b, const char *indent, const shader_t *sh, char *config_render(const config_t *c) { cfgbuf_t b = {0}; - cb_add(&b, "// sl0ppty config, as it currently stands.\n"); + cb_add(&b, "// slosh config, as it currently stands.\n"); cb_add(&b, "//\n"); - cb_add(&b, "// Written by `sl0ppty --dump-config`, so every value here is\n"); + cb_add(&b, "// Written by `slosh --dump-config`, so every value here is\n"); cb_add(&b, "// the one in force rather than one somebody typed up. Delete\n"); cb_add(&b, "// anything you do not want to pin; what is missing is a\n"); cb_add(&b, "// default, and defaults are allowed to improve.\n"); @@ -1423,7 +1423,7 @@ char *config_render(const config_t *c) { if (c->shader_dir) cb_qstr(&b, "shader_dir", c->shader_dir, NULL); else - cb_add(&b, "// shader_dir \"~/.config/sl0ppty/shaders\"\n"); + cb_add(&b, "// shader_dir \"~/.config/slosh/shaders\"\n"); if (c->nproject_roots) { cb_add(&b, "project_roots"); for (size_t i = 0; i < c->nproject_roots; i++) { @@ -1438,7 +1438,7 @@ char *config_render(const config_t *c) { if (c->project_layout) cb_qstr(&b, "project_layout", c->project_layout, NULL); else - cb_add(&b, "// project_layout \"~/.config/sl0ppty/project.layout.kdl\"\n"); + cb_add(&b, "// project_layout \"~/.config/slosh/project.layout.kdl\"\n"); cb_add(&b, "\n// ---- colour ----\ntheme {\n"); for (size_t i = 0; i < sizeof THEME_COLORS / sizeof *THEME_COLORS; i++) @@ -1552,17 +1552,17 @@ static action_t action_by_name(const char *name) { const char *config_default_path(void) { static char path[512]; - const char *explicit_ = getenv("SL0PPTY_CONFIG"); + const char *explicit_ = getenv("SLOSH_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/sl0ppty/config.kdl", xdg); + snprintf(path, sizeof path, "%s/slosh/config.kdl", xdg); else { const char *home = getenv("HOME"); - snprintf(path, sizeof path, "%s/.config/sl0ppty/config.kdl", + snprintf(path, sizeof path, "%s/.config/slosh/config.kdl", home ? home : "."); } return path; @@ -1649,9 +1649,8 @@ static void complain_unknown_top(config_t *c, const kdl_node_t *root, char *err, if (!n || !n->name) continue; if (config_is_setting(n->name)) continue; if (strcmp(n->name, "layout") == 0) - complain( - c, err, errcap, n->line, - "this is a layout, not a config: `sl0ppty --layout` reads those"); + complain(c, err, errcap, n->line, + "this is a layout, not a config: `slosh --layout` reads those"); else complain(c, err, errcap, n->line, "unknown setting: %s", n->name); } diff --git a/src/config.h b/src/config.h index 6609ea3..a8b94f5 100644 --- a/src/config.h +++ b/src/config.h @@ -4,8 +4,8 @@ * config file costs you a warning, never a terminal (the fail-open property * D9 asks of the CLI, applied to the mux itself). */ -#ifndef SL0PPTY_CONFIG_H -#define SL0PPTY_CONFIG_H +#ifndef SLOSH_CONFIG_H +#define SLOSH_CONFIG_H #include <stdbool.h> #include <stddef.h> @@ -13,7 +13,7 @@ #include "expr.h" #include "shader.h" -#include "sl0ppty.h" +#include "slosh.h" /* Pane states a shader can be hung off, in the order they are tested. Only * states a pane can actually be seen in — which `dead` now is: a pane whose @@ -137,7 +137,7 @@ typedef struct { * Discoverability for a frame whose affordances are mostly one character * wide; off if you already know them. */ bool hints; - /* What sl0ppty this is, in the middle of the status line, whenever there is + /* What slosh this is, in the middle of the status line, whenever there is * no hint to put there. The slot is otherwise empty most of the time, and * "which build am I attached to" is the first question when a session is * behaving oddly -- a session keeps the binary it started with, so the @@ -377,7 +377,7 @@ typedef struct { char *shader_dir; /* Where projects live: `project_roots "~/dev" "~/work" depth=2`. A project is - * a subdirectory of one of these with a `sl0ppty.layout.kdl` in it -- or a + * a subdirectory of one of these with a `slosh.layout.kdl` in it -- or a * `.git`, which gets `project_layout` instead. Empty means the feature is * dormant and costs nothing. * @@ -420,7 +420,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); -/* $SL0PPTY_CONFIG, else $XDG_CONFIG_HOME/sl0ppty/config.kdl, else ~/.config/… */ +/* $SLOSH_CONFIG, else $XDG_CONFIG_HOME/slosh/config.kdl, else ~/.config/… */ const char *config_default_path(void); /* Every complaint from the last load, oldest first: "config.kdl:12: ...". * Returns how many were written. */ @@ -497,4 +497,4 @@ const char *config_action_group(action_t a); /* "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 /* SL0PPTY_CONFIG_H */ +#endif /* SLOSH_CONFIG_H */ @@ -33,8 +33,8 @@ * rather than a trap: an expression that is wrong should look wrong, not take * the session with it. */ -#ifndef SL0PPTY_EXPR_H -#define SL0PPTY_EXPR_H +#ifndef SLOSH_EXPR_H +#define SLOSH_EXPR_H #include <stdbool.h> #include <stddef.h> @@ -88,4 +88,4 @@ int expr_eval(const expr_prog_t *p, const expr_env_t *env); * case there is nothing to reuse. */ bool expr_amount_map(expr_prog_t *p, const expr_env_t *env, uint8_t **out); -#endif /* SL0PPTY_EXPR_H */ +#endif /* SLOSH_EXPR_H */ diff --git a/src/graphics.h b/src/graphics.h index 2967b2a..b3cd6ec 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 SL0PPTY_GRAPHICS_H -#define SL0PPTY_GRAPHICS_H +#ifndef SLOSH_GRAPHICS_H +#define SLOSH_GRAPHICS_H #include <stdbool.h> #include <stddef.h> @@ -85,4 +85,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 /* SL0PPTY_GRAPHICS_H */ +#endif /* SLOSH_GRAPHICS_H */ diff --git a/src/headless.c b/src/headless.c index e1fcaf5..399a7ea 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 "sl0ppty.h" +#include "slosh.h" #include <poll.h> #include <stdio.h> @@ -67,13 +67,13 @@ int run_headless(const char *const argv[], uint16_t cols, uint16_t rows, app_t *a = app_new(argv, cols, rows); if (!a) { - fprintf(stderr, "sl0ppty: cannot spawn pane\n"); + fprintf(stderr, "slosh: 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, "sl0ppty: %s: %s\n", layout, err[0] ? err : "bad layout"); + fprintf(stderr, "slosh: %s: %s\n", layout, err[0] ? err : "bad layout"); } app_resize(a, cols, rows); screen_t s; @@ -108,7 +108,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, "sl0ppty: unknown command: %s\n", line); + fprintf(stderr, "slosh: 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 4329f78..adda27a 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 SL0PPTY_INPUT_H -#define SL0PPTY_INPUT_H +#ifndef SLOSH_INPUT_H +#define SLOSH_INPUT_H #include <stdbool.h> #include <stddef.h> @@ -91,4 +91,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 /* SL0PPTY_INPUT_H */ +#endif /* SLOSH_INPUT_H */ @@ -1,6 +1,6 @@ /* A minimal JSON writer. No parser: we only ever emit. */ -#ifndef SL0PPTY_JSON_H -#define SL0PPTY_JSON_H +#ifndef SLOSH_JSON_H +#define SLOSH_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 /* SL0PPTY_JSON_H */ +#endif /* SLOSH_JSON_H */ diff --git a/src/jsonval.h b/src/jsonval.h index 9d0a5d2..1eedb4c 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 SL0PPTY_JSONVAL_H -#define SL0PPTY_JSONVAL_H +#ifndef SLOSH_JSONVAL_H +#define SLOSH_JSONVAL_H #include <stdbool.h> #include <stddef.h> @@ -42,4 +42,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 /* SL0PPTY_JSONVAL_H */ +#endif /* SLOSH_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 SL0PPTY_KDL_H -#define SL0PPTY_KDL_H +#ifndef SLOSH_KDL_H +#define SLOSH_KDL_H #include <stdbool.h> #include <stddef.h> @@ -47,4 +47,4 @@ const char *kdl_prop(const kdl_node_t *n, const char *key, 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 /* SL0PPTY_KDL_H */ +#endif /* SLOSH_KDL_H */ @@ -1,15 +1,15 @@ /* Entry point and argument parsing. * - * 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 + * slosh attach to session "main", creating it if needed + * slosh -s NAME ... a named session + * slosh ls live sessions + * slosh cmd LINE one control command against a session + * slosh --server NAME run a session in the foreground (internal) + * slosh --script the headless driver (no server, no tty) + * slosh --headless run once, print the screen */ #define _GNU_SOURCE -#include "sl0ppty.h" +#include "slosh.h" #include <stdio.h> #include <stdlib.h> @@ -59,7 +59,7 @@ static bool looks_like_layout(const char *path) { return layout; } -/* `sl0ppty --check FILE` on a layout. Telling somebody they handed a layout to +/* `slosh --check FILE` on a layout. Telling somebody they handed a layout to * the config checker was honest and unhelpful: the file they want checked is * the one they were told to check. Same output shape, same exit status. */ static int check_layout(const char *path) { @@ -76,7 +76,7 @@ static int check_layout(const char *path) { return n ? 1 : 0; } -/* `sl0ppty --check [FILE]`: read a config the way a session would and say what +/* `slosh --check [FILE]`: read a config the way a session would and say what * it could not honour, one problem per line, `file:line: what`. Exits 1 when * there is anything to say, so it drops into an editor's compile step or a * pre-commit hook without any glue. @@ -123,7 +123,7 @@ static int check_config(const char *path) { } static void usage(void) { - fputs("usage: sl0ppty [-s NAME] [--layout FILE] [--no-reload]\n" + fputs("usage: slosh [-s NAME] [--layout FILE] [--no-reload]\n" " [--version] [--dump-config] [--check [FILE]]\n" " [ls | cmd LINE | -- CMD...]\n", stderr); @@ -163,7 +163,7 @@ int main(int argc, char **argv) { watch = false; else if (strcmp(a, "--check") == 0) { /* An optional path, so it lints a file you have not installed yet: - * `sl0ppty --check theme.kdl`. Without one it checks the config a session + * `slosh --check theme.kdl`. Without one it checks the config a session * would actually read. A layout is checked as a layout: one flag, and the * file decides which schema it is held to. */ const char *path = @@ -172,7 +172,7 @@ int main(int argc, char **argv) { : check_config(path); } else if (strcmp(a, "--dump-config") == 0) { /* Every setting with its *default*, as a file you could have written: - * `sl0ppty --dump-config > ~/.config/sl0ppty/config.kdl` is a supported + * `slosh --dump-config > ~/.config/slosh/config.kdl` is a supported * way to start one. Deliberately not the values a config in effect gives * them -- this is the file to begin from, and `--check` is the one that * reads yours and says what it understood. */ @@ -183,7 +183,7 @@ int main(int argc, char **argv) { } else if (strcmp(a, "--version") == 0) { /* The same string the status line shows, so "which build is this" has * one answer whether you ask the binary or the session. */ - printf("sl0ppty %s\n", SL0PPTY_VERSION); + printf("slosh %s\n", SLOSH_VERSION); return 0; } else if (strcmp(a, "ls") == 0) list = true; @@ -203,7 +203,7 @@ int main(int argc, char **argv) { cmd_argv[cmd_n++] = argv[j]; break; } else { - fprintf(stderr, "sl0ppty: unknown argument: %s\n", a); + fprintf(stderr, "slosh: unknown argument: %s\n", a); usage(); return 2; } @@ -231,7 +231,7 @@ int main(int argc, char **argv) { if (cmd_line) { int fd = server_connect(name); if (fd < 0) { - fprintf(stderr, "sl0ppty: no session named %s\n", name); + fprintf(stderr, "slosh: no session named %s\n", name); return 1; } return client_control(fd, cmd_line); @@ -247,7 +247,7 @@ int main(int argc, char **argv) { int fd = server_connect(name); if (fd < 0) fd = server_spawn(name, cmd_argv, cols, rows, layout, watch); if (fd < 0) { - fprintf(stderr, "sl0ppty: cannot start session %s\n", name); + fprintf(stderr, "slosh: cannot start session %s\n", name); return 1; } return client_run(fd); diff --git a/src/osc5577.h b/src/osc5577.h index 21b82a1..e6033f1 100644 --- a/src/osc5577.h +++ b/src/osc5577.h @@ -23,8 +23,8 @@ * discards an OSC it does not know — nothing is drawn, and we need no * buffering that could stall a pane's output. */ -#ifndef SL0PPTY_OSC5577_H -#define SL0PPTY_OSC5577_H +#ifndef SLOSH_OSC5577_H +#define SLOSH_OSC5577_H #include <stdbool.h> #include <stddef.h> @@ -53,4 +53,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 /* SL0PPTY_OSC5577_H */ +#endif /* SLOSH_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 "sl0ppty.h" +#include "slosh.h" #include <errno.h> #include <stdio.h> @@ -155,7 +155,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-reply;sl0ppty;1\033\\"; + const char *reply = "\033]5577;1;hello-reply;slosh;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 */ @@ -6,7 +6,7 @@ * session happened to be in. Silently \u2014 which is the worst way for a path to * be wrong, because the pane still starts and still works. */ -#include "sl0ppty.h" +#include "slosh.h" #include <sys/stat.h> @@ -12,11 +12,11 @@ * library already handles. Decoding only, never encoding — we hand the client * RGBA. */ -#ifndef SL0PPTY_PNG_H -#define SL0PPTY_PNG_H +#ifndef SLOSH_PNG_H +#define SLOSH_PNG_H /* Install the process-global PNG decoder. Must be called before any terminal * exists, and is idempotent. */ void png_init(void); -#endif /* SL0PPTY_PNG_H */ +#endif /* SLOSH_PNG_H */ diff --git a/src/project.c b/src/project.c index 381d17f..9146971 100644 --- a/src/project.c +++ b/src/project.c @@ -9,7 +9,7 @@ #include <string.h> #include <sys/stat.h> -#include "sl0ppty.h" +#include "slosh.h" /* FNV-1a over the resolved path, printed as eight hex digits. * diff --git a/src/project.h b/src/project.h index 1c2a103..6bf3021 100644 --- a/src/project.h +++ b/src/project.h @@ -10,8 +10,8 @@ * which is nothing next to the keystroke that asked -- and an answer nobody * remembered cannot be stale, which no watcher can promise on a bind mount. */ -#ifndef SL0PPTY_PROJECT_H -#define SL0PPTY_PROJECT_H +#ifndef SLOSH_PROJECT_H +#define SLOSH_PROJECT_H #include <stdbool.h> #include <stddef.h> @@ -20,7 +20,7 @@ /* The file a project uses to say what it needs. One name, so there is no * precedence question: a layout file by D2's rule, checked by `--check`, and * highlighted by anything that knows KDL. */ -#define PROJECT_LAYOUT_FILE "sl0ppty.layout.kdl" +#define PROJECT_LAYOUT_FILE "slosh.layout.kdl" /* How many projects one session will look at. A picker is not a filesystem * browser: past this many the answer to "which project" is a search, not a @@ -61,4 +61,4 @@ bool project_find(const char *const *roots, int depth, const char *name, * worktrees of one repo are two workspaces, which is what they are. */ void project_slug(const char *path, const char *name, char *out, size_t cap); -#endif /* SL0PPTY_PROJECT_H */ +#endif /* SLOSH_PROJECT_H */ diff --git a/src/proto.c b/src/proto.c index 100791e..3c14f3b 100644 --- a/src/proto.c +++ b/src/proto.c @@ -95,9 +95,9 @@ 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/sl0ppty", run); + snprintf(out, cap, "%s/slosh", run); else - snprintf(out, cap, "/tmp/sl0ppty-%u", (unsigned)getuid()); + snprintf(out, cap, "/tmp/slosh-%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 3f39d0e..e6cd42c 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 SL0PPTY_PROTO_H -#define SL0PPTY_PROTO_H +#ifndef SLOSH_PROTO_H +#define SLOSH_PROTO_H #include <stdbool.h> #include <stddef.h> @@ -57,7 +57,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/sl0ppty/<name>.sock, or /tmp/sl0ppty-<uid>/<name>.sock. +/* $XDG_RUNTIME_DIR/slosh/<name>.sock, or /tmp/slosh-<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); @@ -65,4 +65,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 /* SL0PPTY_PROTO_H */ +#endif /* SLOSH_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 "sl0ppty.h" +#include "slosh.h" #include <errno.h> #include <fcntl.h> @@ -65,7 +65,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("SL0PPTY", "1", 1); + setenv("SLOSH", "1", 1); unsetenv("ZELLIJ"); signal(SIGPIPE, SIG_DFL); diff --git a/src/screen.c b/src/screen.c index 616bf30..b3c8564 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 "sl0ppty.h" +#include "slosh.h" #include <ghostty/vt.h> diff --git a/src/server.c b/src/server.c index 398d279..578ffff 100644 --- a/src/server.c +++ b/src/server.c @@ -44,7 +44,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 sl0ppty replaces had a + * This distinction is not fussiness. The zellij fork slosh 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 @@ -239,21 +239,21 @@ static bool watch_hit(const watchset_t *w, const char *name) { /* What every pane is told about the session around it. Panes inherit this * process's environment, so this is how a program *inside* one learns which - * session it is in -- and therefore which socket to talk to. `SL0PPTY=1` + * session it is in -- and therefore which socket to talk to. `SLOSH=1` * (pty.c) says "you are in a pane"; this says which one of possibly several, * which is the part a program cannot work out for itself: `ls` lists them all * and none of them is labelled "the one you are in". * * NULL for a mode with no socket, and that case is why this is a function both * modes call rather than two setenvs in the mode that has one. `--script` has - * always been *documented* as leaving `SL0PPTY_SESSION` unset -- but a value it + * always been *documented* as leaving `SLOSH_SESSION` unset -- but a value it * never set was a value it inherited, and a script driver started from inside a * pane handed its own panes the *outer* session's name. Anything following the - * documented recipe (`-s ${SL0PPTY_SESSION:-main} cmd`) then sent its commands + * documented recipe (`-s ${SLOSH_SESSION:-main} cmd`) then sent its commands * to a session it was not in, confidently, because the name it read was real. * - * `SL0PPTY_BIN` is set in both modes for the same reason it is set in either: a - * program in a pane that finds `sl0ppty` missing from its PATH -- a session + * `SLOSH_BIN` is set in both modes for the same reason it is set in either: a + * program in a pane that finds `slosh` missing from its PATH -- a session * started from a build tree, an agent with a trimmed environment -- can * otherwise see the session it is in and have no way to reach it. Read from * /proc rather than argv[0], which is whatever the caller felt like passing, @@ -261,14 +261,14 @@ static bool watch_hit(const watchset_t *w, const char *name) { * pane, not one that made some pane somewhere. */ void session_env(const char *name) { if (name) - setenv("SL0PPTY_SESSION", name, 1); + setenv("SLOSH_SESSION", name, 1); else - unsetenv("SL0PPTY_SESSION"); + unsetenv("SLOSH_SESSION"); char self[512]; ssize_t sn = readlink("/proc/self/exe", self, sizeof self - 1); if (sn > 0) { self[sn] = 0; - setenv("SL0PPTY_BIN", self, 1); + setenv("SLOSH_BIN", self, 1); } } @@ -278,8 +278,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, "sl0ppty: cannot listen on %s: %s\n", path, - strerror(errno)); + fprintf(stderr, "slosh: cannot listen on %s: %s\n", path, strerror(errno)); return 1; } @@ -305,7 +304,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, "sl0ppty: %s: %s\n", layout, err[0] ? err : "bad layout"); + fprintf(stderr, "slosh: %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 6b58aa6..b5d114a 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 SL0PPTY_SERVER_H -#define SL0PPTY_SERVER_H +#ifndef SLOSH_SERVER_H +#define SLOSH_SERVER_H #include <stdbool.h> #include <stdint.h> -#include "sl0ppty.h" +#include "slosh.h" /* Run the session in this process (the daemonised half). `watch` re-reads the * config when the file changes; see server.c for why that is a flag and not a @@ -25,4 +25,4 @@ int server_connect(const char *name); int client_run(int fd); int client_control(int fd, const char *line); -#endif /* SL0PPTY_SERVER_H */ +#endif /* SLOSH_SERVER_H */ diff --git a/src/shader.c b/src/shader.c index 6f24564..b748e21 100644 --- a/src/shader.c +++ b/src/shader.c @@ -247,20 +247,20 @@ static size_t load_one(const char *path, char *err, size_t errcap) { union { void *obj; const shader_plugin_t *(*fn)(void); - } entry = {.obj = dlsym(lib, SL0PPTY_SHADER_PLUGIN_SYM)}; + } entry = {.obj = dlsym(lib, SLOSH_SHADER_PLUGIN_SYM)}; if (!entry.obj) { if (err && !err[0]) - snprintf(err, errcap, "%s: no " SL0PPTY_SHADER_PLUGIN_SYM, path); + snprintf(err, errcap, "%s: no " SLOSH_SHADER_PLUGIN_SYM, path); dlclose(lib); return 0; } const shader_plugin_t *t = entry.fn(); - if (!t || t->abi != SL0PPTY_SHADER_ABI) { + if (!t || t->abi != SLOSH_SHADER_ABI) { if (err && !err[0]) snprintf(err, errcap, "%s: shader ABI %u, we speak %u", path, - t ? t->abi : 0, SL0PPTY_SHADER_ABI); + t ? t->abi : 0, SLOSH_SHADER_ABI); dlclose(lib); return 0; } diff --git a/src/shader.h b/src/shader.h index 8cee437..a6d9f65 100644 --- a/src/shader.h +++ b/src/shader.h @@ -19,15 +19,15 @@ * Shaders chain: each is a complete pass, so `grayscale` then `tint` differs * from `tint` then `grayscale`, and both are expressible. */ -#ifndef SL0PPTY_SHADER_H -#define SL0PPTY_SHADER_H +#ifndef SLOSH_SHADER_H +#define SLOSH_SHADER_H #include <stdbool.h> #include <stddef.h> #include <stdint.h> #include "shader_abi.h" -#include "sl0ppty.h" +#include "slosh.h" /* Per pane, and separately per config. Small and fixed: a stack this deep is * already a lot of passes over the same cells. */ @@ -80,4 +80,4 @@ size_t shader_load_dir(const char *dir, char *err, size_t errcap); void shade_apply(screen_t *s, const shader_t *shaders, size_t n, rect_t r, const rect_t *hole, const shade_ctx_t *base); -#endif /* SL0PPTY_SHADER_H */ +#endif /* SLOSH_SHADER_H */ diff --git a/src/shader_abi.h b/src/shader_abi.h index 5cfb560..be737c4 100644 --- a/src/shader_abi.h +++ b/src/shader_abi.h @@ -6,13 +6,13 @@ * cannot reach anything else, because nothing else is declared here. * * Everything in here is ABI. Changing the layout of these structs breaks - * every plugin built against the old one, so SL0PPTY_SHADER_ABI is bumped + * every plugin built against the old one, so SLOSH_SHADER_ABI is bumped * when they change, and a plugin that reports the wrong version (or the wrong * sizes, which catches a plugin built against an edited copy of this file) is * refused at load rather than trusted into a crash. */ -#ifndef SL0PPTY_SHADER_ABI_H -#define SL0PPTY_SHADER_ABI_H +#ifndef SLOSH_SHADER_ABI_H +#define SLOSH_SHADER_ABI_H #include <stdbool.h> #include <stddef.h> @@ -21,7 +21,7 @@ /* 3: shade_ctx_t gained `state_ms`, so an effect can know how long the pane has * been as it is and not only what time it is; struct shader gained * `channels`, which is the pass's business rather than a shader's. */ -#define SL0PPTY_SHADER_ABI 3 +#define SLOSH_SHADER_ABI 3 /* Which of a cell's two colours a pass is allowed to keep. Enforced by the * pass, not by the shader: every shader writes whatever it writes, and the @@ -134,9 +134,9 @@ struct shader { * * A shared library dropped in the shader directory, exporting one symbol: * - * const shader_plugin_t *sl0ppty_shader_plugin(void); + * const shader_plugin_t *slosh_shader_plugin(void); * - * SL0PPTY_SHADER_PLUGIN() writes that for you. See + * SLOSH_SHADER_PLUGIN() writes that for you. See * contrib/shader-plugin/ for a complete one. */ @@ -146,7 +146,7 @@ typedef struct { } shader_def_t; typedef struct { - uint32_t abi; /* SL0PPTY_SHADER_ABI it was built against */ + uint32_t abi; /* SLOSH_SHADER_ABI it was built against */ uint32_t cell_size; /* the three sizes catch a plugin built against a */ uint32_t ctx_size; /* copy of this header that has drifted, which a */ uint32_t shader_size; /* version number alone would not */ @@ -155,14 +155,14 @@ typedef struct { const shader_def_t *shaders; } shader_plugin_t; -#define SL0PPTY_SHADER_PLUGIN_SYM "sl0ppty_shader_plugin" +#define SLOSH_SHADER_PLUGIN_SYM "slosh_shader_plugin" /* Define the entry point. `defs` is a static array of shader_def_t. */ -#define SL0PPTY_SHADER_PLUGIN(bundle_name, defs) \ - const shader_plugin_t *sl0ppty_shader_plugin(void); \ - const shader_plugin_t *sl0ppty_shader_plugin(void) { \ +#define SLOSH_SHADER_PLUGIN(bundle_name, defs) \ + const shader_plugin_t *slosh_shader_plugin(void); \ + const shader_plugin_t *slosh_shader_plugin(void) { \ static const shader_plugin_t table = { \ - .abi = SL0PPTY_SHADER_ABI, \ + .abi = SLOSH_SHADER_ABI, \ .cell_size = sizeof(cell_t), \ .ctx_size = sizeof(shade_ctx_t), \ .shader_size = sizeof(shader_t), \ @@ -173,4 +173,4 @@ typedef struct { return &table; \ } -#endif /* SL0PPTY_SHADER_ABI_H */ +#endif /* SLOSH_SHADER_ABI_H */ diff --git a/src/sl0ppty.h b/src/slosh.h index 913e3de..834879f 100644 --- a/src/sl0ppty.h +++ b/src/slosh.h @@ -1,6 +1,6 @@ -/* sl0ppty — common types. See DESIGN.md. */ -#ifndef SL0PPTY_H -#define SL0PPTY_H +/* slosh — common types. See DESIGN.md. */ +#ifndef SLOSH_H +#define SLOSH_H #include <stdbool.h> #include <stddef.h> @@ -279,4 +279,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 /* SL0PPTY_H */ +#endif /* SLOSH_H */ |
