@@ -109,6 +109,7 @@ export function Prompt(props: PromptProps) {
109109 const dimensions = useTerminalDimensions ( )
110110 const { theme, syntax } = useTheme ( )
111111 const kv = useKV ( )
112+ const [ autoaccept , setAutoaccept ] = kv . signal < "none" | "edit" > ( "permission_auto_accept" , "edit" )
112113 const animationsEnabled = createMemo ( ( ) => kv . get ( "animations_enabled" , true ) )
113114 const list = createMemo ( ( ) => props . placeholders ?. normal ?? [ ] )
114115 const shell = createMemo ( ( ) => props . placeholders ?. shell ?? [ ] )
@@ -137,7 +138,7 @@ export function Prompt(props: PromptProps) {
137138 } )
138139 const [ auto , setAuto ] = createSignal < AutocompleteRef > ( )
139140 const currentProviderLabel = createMemo ( ( ) => local . model . parsed ( ) . provider )
140- const hasRightContent = createMemo ( ( ) => Boolean ( props . right ) )
141+ const hasRightContent = createMemo ( ( ) => Boolean ( props . right ) || autoaccept ( ) === "edit" )
141142
142143 function promptModelWarning ( ) {
143144 toast . show ( {
@@ -254,6 +255,17 @@ export function Prompt(props: PromptProps) {
254255
255256 command . register ( ( ) => {
256257 return [
258+ {
259+ title : autoaccept ( ) === "none" ? "Enable autoedit" : "Disable autoedit" ,
260+ value : "permission.auto_accept.toggle" ,
261+ search : "toggle permissions" ,
262+ keybind : "permission_auto_accept_toggle" ,
263+ category : "Agent" ,
264+ onSelect : ( dialog ) => {
265+ setAutoaccept ( ( ) => ( autoaccept ( ) === "none" ? "edit" : "none" ) )
266+ dialog . clear ( )
267+ } ,
268+ } ,
257269 {
258270 title : "Clear prompt" ,
259271 value : "prompt.clear" ,
@@ -1283,6 +1295,11 @@ export function Prompt(props: PromptProps) {
12831295 < Show when = { hasRightContent ( ) } >
12841296 < box flexDirection = "row" gap = { 1 } alignItems = "center" >
12851297 { props . right }
1298+ < Show when = { autoaccept ( ) === "edit" } >
1299+ < text >
1300+ < span style = { { fg : theme . warning } } > autoedit</ span >
1301+ </ text >
1302+ </ Show >
12861303 </ box >
12871304 </ Show >
12881305 </ box >
0 commit comments