summaryrefslogtreecommitdiffhomepage
path: root/internal/tui/tui.go
diff options
context:
space:
mode:
authorKujtim Hoxha <[email protected]>2025-04-04 15:41:25 +0200
committerKujtim Hoxha <[email protected]>2025-04-04 15:41:25 +0200
commit64199736677a8ed303291c763975d484ac8f7e99 (patch)
treed5b59ff3f541187f5310c8dddd0fbe76df1c3071 /internal/tui/tui.go
parent8f8b403bbcb171fae525e7239f2f7b9d46c78b77 (diff)
downloadopencode-64199736677a8ed303291c763975d484ac8f7e99.tar.gz
opencode-64199736677a8ed303291c763975d484ac8f7e99.zip
Enhance bash tool security and improve permission dialog UI
- Expand safe command list with common dev tools (git, go, node, python, etc.) - Improve multi-word command detection for better security checks - Add scrollable viewport to permission dialog for better diff viewing - Fix command batching in TUI update to properly handle multiple commands 🤖 Generated with termai Co-Authored-By: termai <[email protected]>
Diffstat (limited to 'internal/tui/tui.go')
-rw-r--r--internal/tui/tui.go15
1 files changed, 9 insertions, 6 deletions
diff --git a/internal/tui/tui.go b/internal/tui/tui.go
index 97f876a2d..8785b5ab2 100644
--- a/internal/tui/tui.go
+++ b/internal/tui/tui.go
@@ -123,8 +123,6 @@ func (a appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
a.status, _ = a.status.Update(msg)
case util.ErrorMsg:
a.status, _ = a.status.Update(msg)
- case util.ClearStatusMsg:
- a.status, _ = a.status.Update(msg)
case tea.KeyMsg:
if a.editorMode == vimtea.ModeNormal {
switch {
@@ -163,16 +161,21 @@ func (a appModel) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
}
}
}
+
+ var cmds []tea.Cmd
+ s, cmd := a.status.Update(msg)
+ a.status = s
+ cmds = append(cmds, cmd)
if a.dialogVisible {
d, cmd := a.dialog.Update(msg)
a.dialog = d.(core.DialogCmp)
- return a, cmd
+ cmds = append(cmds, cmd)
+ return a, tea.Batch(cmds...)
}
- s, _ := a.status.Update(msg)
- a.status = s
p, cmd := a.pages[a.currentPage].Update(msg)
a.pages[a.currentPage] = p
- return a, cmd
+ cmds = append(cmds, cmd)
+ return a, tea.Batch(cmds...)
}
func (a *appModel) ToggleHelp() {