plan mode: pass --permission-mode plan to claude while /plan is on
This commit is contained in:
1 parent
8a9d8fe607
commit
fa8641f803
3 files changed
+27
No files matched your search
@@ -1709,6 +1709,21 @@ async fn submit(app: &mut App, mut line: String, c: &Ctx<'_>) {
|
||||
)));
|
||||
line = r.prompt;
|
||||
}
|
||||
// a prompt starting with the word `plan` turns plan mode on
|
||||
if line
|
||||
.split_whitespace()
|
||||
.next()
|
||||
.is_some_and(|w| w.eq_ignore_ascii_case("plan"))
|
||||
{
|
||||
let mut al = app.state.allow.lock().unwrap_or_else(|e| e.into_inner());
|
||||
if !al.plan_on() {
|
||||
al.set_plan(true);
|
||||
drop(al);
|
||||
app.t.push(Item::Info(
|
||||
"plan on (prompt starts with `plan`): read-only until the plan is approved".into(),
|
||||
));
|
||||
}
|
||||
}
|
||||
if app
|
||||
.state
|
||||
.allow
|
||||
|
||||
Reference in new issue
Block a user