Skip to content

Commit 5658ce7

Browse files
committed
feat(toggle_tool_output): add command to toggle tools output
1 parent 526e244 commit 5658ce7

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,7 @@ The plugin provides the following actions that can be triggered via keymaps, com
381381
| Navigate to next prompt in history | `<down>` | - | `require('opencode.api').next_history()` |
382382
| Toggle input/output panes | `<tab>` | - | - |
383383
| Swap Opencode pane left/right | `<leader>ox` | `:Opencode swap position` | `require('opencode.api').swap_position()` |
384+
| Toggle tools output (diffs, cmd output, etc.) | - | `:Opencode toggle_tools_output` | `require('opencode.api').toggle_tools_output()` |
384385

385386
---
386387

lua/opencode/api.lua

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ local ui = require('opencode.ui.ui')
99
local icons = require('opencode.ui.icons')
1010
local git_review = require('opencode.git_review')
1111
local history = require('opencode.history')
12+
local config = require('opencode.config')
1213

1314
local M = {}
1415

@@ -907,6 +908,11 @@ function M.permission_deny()
907908
M.respond_to_permission('reject')
908909
end
909910

911+
function M.toggle_tool_output()
912+
config.values.ui.output.tools.show_output = not config.ui.output.tools.show_output
913+
ui.render_output()
914+
end
915+
910916
M.commands = {
911917
open = {
912918
desc = 'Open opencode window (input/output)',
@@ -1196,6 +1202,11 @@ M.commands = {
11961202
desc = 'Open timeline picker to navigate/undo/redo/fork to message',
11971203
fn = M.timeline,
11981204
},
1205+
1206+
toggle_tool_output = {
1207+
desc = 'Toggle tool output visibility in the output window',
1208+
fn = M.toggle_tool_output,
1209+
},
11991210
}
12001211

12011212
M.slash_commands_map = {

0 commit comments

Comments
 (0)