@@ -106,6 +106,7 @@ export function Prompt(props: PromptProps) {
106106 const renderer = useRenderer ( )
107107 const { theme, syntax } = useTheme ( )
108108 const kv = useKV ( )
109+ const [ autoaccept , setAutoaccept ] = kv . signal < "none" | "edit" > ( "permission_auto_accept" , "edit" )
109110 const animationsEnabled = createMemo ( ( ) => kv . get ( "animations_enabled" , true ) )
110111 const list = createMemo ( ( ) => props . placeholders ?. normal ?? [ ] )
111112 const shell = createMemo ( ( ) => props . placeholders ?. shell ?? [ ] )
@@ -228,6 +229,17 @@ export function Prompt(props: PromptProps) {
228229
229230 command . register ( ( ) => {
230231 return [
232+ {
233+ title : autoaccept ( ) === "none" ? "Enable autoedit" : "Disable autoedit" ,
234+ value : "permission.auto_accept.toggle" ,
235+ search : "toggle permissions" ,
236+ keybind : "permission_auto_accept_toggle" ,
237+ category : "Agent" ,
238+ onSelect : ( dialog ) => {
239+ setAutoaccept ( ( ) => ( autoaccept ( ) === "none" ? "edit" : "none" ) )
240+ dialog . clear ( )
241+ } ,
242+ } ,
231243 {
232244 title : "Clear prompt" ,
233245 value : "prompt.clear" ,
@@ -1221,8 +1233,13 @@ export function Prompt(props: PromptProps) {
12211233 ) }
12221234 </ Show >
12231235 </ box >
1224- < Show when = { hasRightContent ( ) } >
1236+ < Show when = { hasRightContent ( ) || autoaccept ( ) === "edit" } >
12251237 < box flexDirection = "row" gap = { 1 } alignItems = "center" >
1238+ < Show when = { autoaccept ( ) === "edit" } >
1239+ < text >
1240+ < span style = { { fg : theme . warning } } > autoedit</ span >
1241+ </ text >
1242+ </ Show >
12261243 { props . right }
12271244 </ box >
12281245 </ Show >
0 commit comments