@@ -77,6 +77,7 @@ export function Prompt(props: PromptProps) {
7777 const renderer = useRenderer ( )
7878 const { theme, syntax } = useTheme ( )
7979 const kv = useKV ( )
80+ const [ autoaccept , setAutoaccept ] = kv . signal < "none" | "edit" > ( "permission_auto_accept" , "edit" )
8081
8182 function promptModelWarning ( ) {
8283 toast . show ( {
@@ -170,6 +171,17 @@ export function Prompt(props: PromptProps) {
170171
171172 command . register ( ( ) => {
172173 return [
174+ {
175+ title : autoaccept ( ) === "none" ? "Enable autoedit" : "Disable autoedit" ,
176+ value : "permission.auto_accept.toggle" ,
177+ search : "toggle permissions" ,
178+ keybind : "permission_auto_accept_toggle" ,
179+ category : "Agent" ,
180+ onSelect : ( dialog ) => {
181+ setAutoaccept ( ( ) => ( autoaccept ( ) === "none" ? "edit" : "none" ) )
182+ dialog . clear ( )
183+ } ,
184+ } ,
173185 {
174186 title : "Clear prompt" ,
175187 value : "prompt.clear" ,
@@ -996,23 +1008,30 @@ export function Prompt(props: PromptProps) {
9961008 cursorColor = { theme . text }
9971009 syntaxStyle = { syntax ( ) }
9981010 />
999- < box flexDirection = "row" flexShrink = { 0 } paddingTop = { 1 } gap = { 1 } >
1000- < text fg = { highlight ( ) } >
1001- { store . mode === "shell" ? "Shell" : Locale . titlecase ( local . agent . current ( ) . name ) } { " " }
1002- </ text >
1003- < Show when = { store . mode === "normal" } >
1004- < box flexDirection = "row" gap = { 1 } >
1005- < text flexShrink = { 0 } fg = { keybind . leader ? theme . textMuted : theme . text } >
1006- { local . model . parsed ( ) . model }
1007- </ text >
1008- < text fg = { theme . textMuted } > { local . model . parsed ( ) . provider } </ text >
1009- < Show when = { showVariant ( ) } >
1010- < text fg = { theme . textMuted } > ·</ text >
1011- < text >
1012- < span style = { { fg : theme . warning , bold : true } } > { local . model . variant . current ( ) } </ span >
1011+ < box flexDirection = "row" flexShrink = { 0 } paddingTop = { 1 } gap = { 1 } justifyContent = "space-between" >
1012+ < box flexDirection = "row" gap = { 1 } >
1013+ < text fg = { highlight ( ) } >
1014+ { store . mode === "shell" ? "Shell" : Locale . titlecase ( local . agent . current ( ) . name ) } { " " }
1015+ </ text >
1016+ < Show when = { store . mode === "normal" } >
1017+ < box flexDirection = "row" gap = { 1 } >
1018+ < text flexShrink = { 0 } fg = { keybind . leader ? theme . textMuted : theme . text } >
1019+ { local . model . parsed ( ) . model }
10131020 </ text >
1014- </ Show >
1015- </ box >
1021+ < text fg = { theme . textMuted } > { local . model . parsed ( ) . provider } </ text >
1022+ < Show when = { showVariant ( ) } >
1023+ < text fg = { theme . textMuted } > ·</ text >
1024+ < text >
1025+ < span style = { { fg : theme . warning , bold : true } } > { local . model . variant . current ( ) } </ span >
1026+ </ text >
1027+ </ Show >
1028+ </ box >
1029+ </ Show >
1030+ </ box >
1031+ < Show when = { autoaccept ( ) === "edit" } >
1032+ < text >
1033+ < span style = { { fg : theme . warning } } > autoedit</ span >
1034+ </ text >
10161035 </ Show >
10171036 </ box >
10181037 </ box >
0 commit comments