@@ -139,6 +139,7 @@ export function Prompt(props: PromptProps) {
139139 const dimensions = useTerminalDimensions ( )
140140 const { theme, syntax } = useTheme ( )
141141 const kv = useKV ( )
142+ const [ autoaccept , setAutoaccept ] = kv . signal < "none" | "edit" > ( "permission_auto_accept" , "edit" )
142143 const animationsEnabled = createMemo ( ( ) => kv . get ( "animations_enabled" , true ) )
143144 const list = createMemo ( ( ) => props . placeholders ?. normal ?? [ ] )
144145 const shell = createMemo ( ( ) => props . placeholders ?. shell ?? [ ] )
@@ -383,6 +384,17 @@ export function Prompt(props: PromptProps) {
383384
384385 command . register ( ( ) => {
385386 return [
387+ {
388+ title : autoaccept ( ) === "none" ? "Enable autoedit" : "Disable autoedit" ,
389+ value : "permission.auto_accept.toggle" ,
390+ search : "toggle permissions" ,
391+ keybind : "permission_auto_accept_toggle" ,
392+ category : "Agent" ,
393+ onSelect : ( dialog ) => {
394+ setAutoaccept ( ( ) => ( autoaccept ( ) === "none" ? "edit" : "none" ) )
395+ dialog . clear ( )
396+ } ,
397+ } ,
386398 {
387399 title : "Clear prompt" ,
388400 value : "prompt.clear" ,
@@ -1461,6 +1473,11 @@ export function Prompt(props: PromptProps) {
14611473 </ box >
14621474 < Show when = { hasRightContent ( ) } >
14631475 < box flexDirection = "row" gap = { 1 } alignItems = "center" >
1476+ < Show when = { autoaccept ( ) === "edit" } >
1477+ < text >
1478+ < span style = { { fg : theme . warning } } > autoedit</ span >
1479+ </ text >
1480+ </ Show >
14641481 { props . right }
14651482 </ box >
14661483 </ Show >
0 commit comments