Detailed changes
@@ -522,7 +522,7 @@ func (c *Commands) defaultCommands() []*CommandItem {
commands = append(
commands,
- NewCommandItem(c.com.Styles, "toggle_yolo", "Toggle Yolo Mode", "", ActionToggleYoloMode{}),
+ NewCommandItem(c.com.Styles, "toggle_yolo", "Toggle Yolo Mode", "ctrl+y", ActionToggleYoloMode{}),
NewCommandItem(c.com.Styles, "toggle_help", "Toggle Help", "ctrl+g", ActionToggleHelp{}),
NewCommandItem(c.com.Styles, "init", "Initialize Project", "", ActionInitializeProject{}),
)
@@ -57,13 +57,14 @@ type KeyMap struct {
}
// Global key maps
- Quit key.Binding
- Help key.Binding
- Commands key.Binding
- Models key.Binding
- Suspend key.Binding
- Sessions key.Binding
- Tab key.Binding
+ Quit key.Binding
+ Help key.Binding
+ Commands key.Binding
+ Models key.Binding
+ Suspend key.Binding
+ Sessions key.Binding
+ Tab key.Binding
+ ToggleYolo key.Binding
}
func DefaultKeyMap() KeyMap {
@@ -96,6 +97,10 @@ func DefaultKeyMap() KeyMap {
key.WithKeys("tab"),
key.WithHelp("tab", "change focus"),
),
+ ToggleYolo: key.NewBinding(
+ key.WithKeys("ctrl+y"),
+ key.WithHelp("ctrl+y", "toggle yolo"),
+ ),
}
km.Editor.AddFile = key.NewBinding(
@@ -1805,6 +1805,11 @@ func (m *UI) handleKeyPressMsg(msg tea.KeyPressMsg) tea.Cmd {
}
cmds = append(cmds, tea.Suspend)
return true
+ case key.Matches(msg, m.keyMap.ToggleYolo):
+ yolo := !m.com.Workspace.PermissionSkipRequests()
+ m.com.Workspace.PermissionSetSkipRequests(yolo)
+ m.setEditorPrompt(yolo)
+ return true
}
return false
}
@@ -2410,6 +2415,7 @@ func (m *UI) FullHelp() [][]key.Binding {
commands,
k.Models,
k.Sessions,
+ k.ToggleYolo,
)
if hasSession {
mainBinds = append(mainBinds, k.Chat.NewSession)
@@ -2471,6 +2477,7 @@ func (m *UI) FullHelp() [][]key.Binding {
commands,
k.Models,
k.Sessions,
+ k.ToggleYolo,
},
)
editorBinds := []key.Binding{