@@ -75,6 +75,7 @@ export function Prompt(props: PromptProps) {
7575 const renderer = useRenderer ( )
7676 const { theme, syntax } = useTheme ( )
7777 const kv = useKV ( )
78+ const [ autoaccept , setAutoaccept ] = kv . signal < "none" | "edit" > ( "permission_auto_accept" , "edit" )
7879
7980 function promptModelWarning ( ) {
8081 toast . show ( {
@@ -168,6 +169,17 @@ export function Prompt(props: PromptProps) {
168169
169170 command . register ( ( ) => {
170171 return [
172+ {
173+ title : autoaccept ( ) === "none" ? "Enable autoedit" : "Disable autoedit" ,
174+ value : "permission.auto_accept.toggle" ,
175+ search : "toggle permissions" ,
176+ keybind : "permission_auto_accept_toggle" ,
177+ category : "Agent" ,
178+ onSelect : ( dialog ) => {
179+ setAutoaccept ( ( ) => ( autoaccept ( ) === "none" ? "edit" : "none" ) )
180+ dialog . clear ( )
181+ } ,
182+ } ,
171183 {
172184 title : "Clear prompt" ,
173185 value : "prompt.clear" ,
@@ -994,23 +1006,30 @@ export function Prompt(props: PromptProps) {
9941006 cursorColor = { theme . text }
9951007 syntaxStyle = { syntax ( ) }
9961008 />
997- < box flexDirection = "row" flexShrink = { 0 } paddingTop = { 1 } gap = { 1 } >
998- < text fg = { highlight ( ) } >
999- { store . mode === "shell" ? "Shell" : Locale . titlecase ( local . agent . current ( ) . name ) } { " " }
1000- </ text >
1001- < Show when = { store . mode === "normal" } >
1002- < box flexDirection = "row" gap = { 1 } >
1003- < text flexShrink = { 0 } fg = { keybind . leader ? theme . textMuted : theme . text } >
1004- { local . model . parsed ( ) . model }
1005- </ text >
1006- < text fg = { theme . textMuted } > { local . model . parsed ( ) . provider } </ text >
1007- < Show when = { showVariant ( ) } >
1008- < text fg = { theme . textMuted } > ·</ text >
1009- < text >
1010- < span style = { { fg : theme . warning , bold : true } } > { local . model . variant . current ( ) } </ span >
1009+ < box flexDirection = "row" flexShrink = { 0 } paddingTop = { 1 } gap = { 1 } justifyContent = "space-between" >
1010+ < box flexDirection = "row" gap = { 1 } >
1011+ < text fg = { highlight ( ) } >
1012+ { store . mode === "shell" ? "Shell" : Locale . titlecase ( local . agent . current ( ) . name ) } { " " }
1013+ </ text >
1014+ < Show when = { store . mode === "normal" } >
1015+ < box flexDirection = "row" gap = { 1 } >
1016+ < text flexShrink = { 0 } fg = { keybind . leader ? theme . textMuted : theme . text } >
1017+ { local . model . parsed ( ) . model }
10111018 </ text >
1012- </ Show >
1013- </ box >
1019+ < text fg = { theme . textMuted } > { local . model . parsed ( ) . provider } </ text >
1020+ < Show when = { showVariant ( ) } >
1021+ < text fg = { theme . textMuted } > ·</ text >
1022+ < text >
1023+ < span style = { { fg : theme . warning , bold : true } } > { local . model . variant . current ( ) } </ span >
1024+ </ text >
1025+ </ Show >
1026+ </ box >
1027+ </ Show >
1028+ </ box >
1029+ < Show when = { autoaccept ( ) === "edit" } >
1030+ < text >
1031+ < span style = { { fg : theme . warning } } > autoedit</ span >
1032+ </ text >
10141033 </ Show >
10151034 </ box >
10161035 </ box >
0 commit comments