Skip to content

skills(cmux-rebuild): name the ZELLIJ_SOCKET_DIR base the split-socket recovery needs - #163

Open
DJRHails wants to merge 1 commit into
mainfrom
docs/cmux-rebuild-socket-dir-base
Open

DJRHails wants to merge 1 commit into
mainfrom
docs/cmux-rebuild-socket-dir-base

Conversation

@DJRHails

@DJRHails DJRHails commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Follow-up to #162, which merged before its review landed.

Why

The recovery step for a socket-dir split said to read each server's dir off its cmdline and pass it as ZELLIJ_SOCKET_DIR. The cmdline path is <base>/<version-subdir>/<session>, and zellij appends the version subdir to ZELLIJ_SOCKET_DIR itself (zellij-utils/src/consts.rs: ZELLIJ_SOCK_DIR pushes CLIENT_SERVER_CONTRACT_DIR after envs::get_socket_dir()), so passing the cmdline's dirname makes zellij attach look in …/contract_version_1/contract_version_1/ and see nothing. Read literally, the documented recovery does not attach.

What

Spell out that <base> is the dir above the version subdir (/run/user/<uid>/zellij or /tmp/zellij-<uid>), with an example cmdline path so the next reader can see where to cut.

Verified

Read upstream consts.rs, sessions.rs, envs.rs and src/commands.rs (server spawned as <exe> --server <socket_path>). All pre-commit hooks passed (prek), including the prose-lint suite; prose-lint.sh on the file reports only pre-existing hits.

via gantry

…t recovery needs

The recovery step added in #162 said to read each server's dir off its
cmdline and pass it as ZELLIJ_SOCKET_DIR. The cmdline path is
<base>/<version-subdir>/<session>, and zellij appends the version subdir
to ZELLIJ_SOCKET_DIR itself (zellij-utils consts.rs: ZELLIJ_SOCK_DIR
pushes CLIENT_SERVER_CONTRACT_DIR), so the cmdline's dirname makes it
look in .../contract_version_1/contract_version_1/ and see nothing.
Spell out that <base> is the dir above the version subdir.

Review finding from PR #162 (merged before the review landed).
@DJRHails

DJRHails commented Sep 7, 2026

Copy link
Copy Markdown
Owner Author

Review Summary

No findings. The doc change is accurate against upstream zellij source (main as of 2026-09-07):

# Severity Finding Resolution
None

Verified:

  • zellij-utils/src/consts.rs: ZELLIJ_SOCK_DIR = (ZELLIJ_SOCKET_DIR | ProjectDirs("org","Zellij Contributors","Zellij").runtime_dir()$XDG_RUNTIME_DIR/zellij | temp_dir()/zellij-<uid>) then push(CLIENT_SERVER_CONTRACT_DIR) = contract_version_1. So <base> is the dir above the version subdir, and passing the cmdline's dirname doubles it exactly as the doc says.
  • zellij-client/src/lib.rs spawn_server: <current_exe> --server <ZELLIJ_SOCK_DIR>/<session> — the cmdline does end in <base>/<version-subdir>/<session>. (The PR body attributes this to src/commands.rs; it lives in zellij-client/src/lib.rs, which does not affect the change.)
  • zellij-utils/src/sessions.rs: attach/list-sessions resolve through ZELLIJ_SOCK_DIR.join(name) / read_dir(ZELLIJ_SOCK_DIR), so the env ZELLIJ_SOCKET_DIR=<base> zellij attach <session> recovery attaches.
  • prose-lint.sh on the file: 3 hits, all pre-existing (em-dash count 44 on both base and head; the two rule-of-three lines 17 and 67 are untouched by this PR).
  • No zellij binary in this container, so the recovery command was not exercised live; source reading only.

Fix commit: none pushed
Reviewed head: 15ed7cc

Verdict: approve

via gantry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant