Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 oncebefore the loop.
active_manifestalready 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 extraprompt.clone()is no longer needed.Testing
cargo test -p kraken-shell: 3 passedcargo clippy -p kraken-shell: cleankraken-shell --workspace foo, moveworkspace.jsonasidefrom a second terminal, press Enter in the first. The prompt changes to
kraken [foo]>, and back tokraken [foo:paper]>once the file is restored.