fix: default permission mode, incognito shortcut + display

- Default permission mode changed from bypass to default
- Removed mode info from status bar (shown on separator line instead)
- Ctrl+I toggles incognito mode
- Incognito mode: amber/yellow separator lines with 🔒 label
  overrides permission mode color when active
- Shift+Tab cycles permission modes
This commit is contained in:
2026-04-03 16:26:45 +02:00
parent 2e034c4347
commit c7b3f6cc54
2 changed files with 22 additions and 7 deletions

View File

@@ -39,7 +39,7 @@ func main() {
system = flag.String("system", defaultSystem, "system prompt")
apiKey = flag.String("api-key", "", "API key (or set MISTRAL_API_KEY env)")
maxTurns = flag.Int("max-turns", 50, "max tool-calling rounds per turn")
permMode = flag.String("permission", "bypass", "permission mode (default, accept_edits, bypass, deny, plan, auto)")
permMode = flag.String("permission", "default", "permission mode (default, accept_edits, bypass, deny, plan, auto)")
incognito = flag.Bool("incognito", false, "incognito mode — no persistence, no learning")
verbose = flag.Bool("verbose", false, "enable debug logging")
version = flag.Bool("version", false, "print version and exit")

View File

@@ -98,6 +98,20 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
m.session.Cancel()
return m, nil
}
case "ctrl+i":
// Toggle incognito
if m.config.Firewall != nil {
m.incognito = m.config.Firewall.Incognito().Toggle()
if m.incognito {
m.messages = append(m.messages, chatMessage{role: "system",
content: "🔒 incognito ON — no persistence, no learning, no logging"})
} else {
m.messages = append(m.messages, chatMessage{role: "system",
content: "🔓 incognito OFF"})
}
m.scrollOffset = 0
}
return m, nil
case "shift+tab":
// Cycle permission mode: bypass → default → plan → bypass
if m.config.Permissions != nil {
@@ -494,7 +508,6 @@ func (m Model) renderMessage(msg chatMessage) []string {
}
func (m Model) renderSeparators() (string, string) {
// Get mode color
lineColor := cSurface // default dim
modeLabel := ""
@@ -504,6 +517,12 @@ func (m Model) renderSeparators() (string, string) {
modeLabel = string(mode)
}
// Incognito overrides everything with amber
if m.incognito {
lineColor = cYellow
modeLabel = "🔒 incognito"
}
lineStyle := lipgloss.NewStyle().Foreground(lineColor)
labelStyle := lipgloss.NewStyle().Foreground(lineColor).Bold(true)
@@ -541,13 +560,9 @@ func (m Model) renderStatus() string {
}
left := sStatusHighlight.Render(provModel)
// Center: cwd + git branch + perm mode
// Center: cwd + git branch
dir := filepath.Base(m.cwd)
centerParts := []string{"📁 " + dir}
if m.config.Permissions != nil {
mode := string(m.config.Permissions.Mode())
centerParts = append(centerParts, sStatusDim.Render(" 🛡 "+mode))
}
if m.gitBranch != "" {
centerParts = append(centerParts, sStatusBranch.Render(" "+m.gitBranch))
}