Skip to content

shell: recompute the scope prompt on every line - #62

Open
Lubov66 wants to merge 1 commit into
krakenfx:mainfrom
Lubov66:fix/shell-prompt-refresh
Open

Lubov66 wants to merge 1 commit into
krakenfx:mainfrom
Lubov66:fix/shell-prompt-refresh

Conversation

@Lubov66

@Lubov66 Lubov66 commented Nov 9, 2026 •

Copy link
Copy Markdown

Problem

The interactive shell computed its scope prompt (e.g. kraken [foo:paper]>)
once, before entering the read loop. If the workspace manifest changed or
disappeared while the shell was open, the prompt kept showing the stale value
until the shell was restarted.

Fix

Call scope_prompt(ctx) at the top of each loop iteration instead of once
before the loop. active_manifest already loads the manifest fresh per call,
so the prompt now reflects the current state on every line. The prompt is
built per iteration and moved straight into spawn_blocking, so the extra
prompt.clone() is no longer needed.

Testing

  • cargo test -p kraken-shell: 3 passed
  • cargo clippy -p kraken-shell: clean
  • Manual: start kraken-shell --workspace foo, move workspace.json aside
    from a second terminal, press Enter in the first. The prompt changes to
    kraken [foo]>, and back to kraken [foo:paper]> once the file is restored.

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