Skip to content

🔧 [P3] Fix shell hook PROMPT_COMMAND duplication issue #143

Closed

Description

@ajianaz

Problem

Bash hook appends to PROMPT_COMMAND without dedup check. Re-sourcing .bashrc on every shell spawn causes exponential chaining:

# First source: PROMPT_COMMAND="uteke_prompt_hook"
# Second source: PROMPT_COMMAND="uteke_prompt_hook;uteke_prompt_hook"
# Third source: PROMPT_COMMAND="uteke_prompt_hook;uteke_prompt_hook;uteke_prompt_hook"

Same issue in zsh with chpwd_functions+=(uteke_chpwd).

Also: UTEKE_PROJECT_STORE unused

The shell hook's sole purpose is setting UTEKE_PROJECT_STORE env var, but no code reads it.

Fix

  1. Check if hook already registered before appending
  2. Either consume UTEKE_PROJECT_STORE in the CLI or remove it

Effort: ~1 hour

Activity

  1. added this to the Backlog milestone on Jun 2, 2026
  2. added
    bug
    v0.0.14
    and removed on Jun 9, 2026
  3. modified the milestones: v0.0.8 — Architecture & Security, on Jun 11, 2026
  4. ajianaz commented on Jun 11, 2026

    @ajianaz
    CollaboratorAuthor

    The duplicate hook issue is already fixed in the current shell hooks (scripts/shell/uteke-hook.bash and .zsh both have guard checks). Fish uses --on-variable PWD which is inherently deduplicated.

    The remaining item is that UTEKE_PROJECT_STORE is set but never consumed by the CLI. This is by design — it's a hook point for future use (e.g., auto-namespace per project, or consume in uteke recall to scope to current project). Keeping it as-is for now. Closing the bug part as fixed.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority:mediumscope:cliv0.0.14

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions