Skip to content

Use current zellij session instead of hardcoded zelma-main #113

Description

@dapi

Problem

zelma instances create currently falls back to the hardcoded zellij session name zelma-main when ZELMA_ZELLIJ_SESSION is not set. This makes the CLI target a fixed session instead of the zellij session where the user is currently working.

Observed touchpoints:

  • internal/create/create.go: DefaultZellijSession = "zelma-main"
  • internal/cli/cli.go: configuredZellijSession() returns create.DefaultZellijSession
  • memory-bank/ops/config.md: documents ZELMA_ZELLIJ_SESSION default as zelma-main
  • tests and e2e fixtures currently assume zelma-main

Desired Behavior

When ZELMA_ZELLIJ_SESSION is set, keep honoring it as an explicit override.

When ZELMA_ZELLIJ_SESSION is not set, resolve the current attached zellij session and use that as the target for instances create / pane launch workflows. zelma-main should not be the production fallback.

Suggested Design Notes

  • Add a small zellij adapter capability to discover the current zellij session from the running environment or zellij CLI, with deterministic diagnostics when unavailable.
  • Keep tests free to use fixture names like zelma-main, but avoid treating that name as a production default.
  • Update help text, config docs and recovery hints so the default is described as “current zellij session”, not zelma-main.
  • Preserve explicit ZELMA_ZELLIJ_SESSION behavior for scripts and Docker e2e.

Acceptance Criteria

  • instances create without ZELMA_ZELLIJ_SESSION targets the current zellij session.
  • instances create with ZELMA_ZELLIJ_SESSION=<name> still targets <name>.
  • No production code path hardcodes zelma-main as the default target session.
  • If current session resolution is impossible, CLI returns an agent-friendly diagnostic and does not launch a pane or write registry state.
  • README/help/config docs describe the new resolution order.
  • Unit tests cover current-session resolution, env override precedence and failure diagnostics.
  • E2E fixtures may still use zelma-main as test data, but tests assert behavior rather than relying on a global production default.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions