Added /thinking slash command to toggle thinking blocks visibility in OpenTUI.#4424
Added /thinking slash command to toggle thinking blocks visibility in OpenTUI.#4424rekram1-node merged 3 commits intodevfrom
/thinking slash command to toggle thinking blocks visibility in OpenTUI.#4424Conversation
…in OpenTUI. Co-authored-by: rekram1-node <rekram1-node@users.noreply.github.com>
|
/oc should there also be an option in the command dialog? (the one opened by ctrl+p)? |
|
Yes, the The |
|
@Lapin hit ctrl+p then type in thinking |
|
|
@Lapin it only shows up once you have started a session so navigate to any session to see it p sure its called toggle thinking but ill double check |




Perfect! My implementation follows the exact same pattern as the other commands. Let me also verify that the command is properly positioned - I placed it after
/timelinewhich makes sense since both are session-related commands.Now let me create a summary of what I've implemented:
Summary
I have successfully implemented the
/thinkingslash command for the OpenTUI. Here's what was done:Changes Made
File:
/home/runner/work/opencode/opencode/packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsxAdded a new slash command entry in the autocomplete options:
How It Works
Default Behavior: By default, all thinking blocks are shown in the TUI (the
concealsignal is initialized totrue)Command Trigger: When the user types
/thinkingand selects it, it triggers the existingsession.toggle.concealcommandToggle Logic: The
session.toggle.concealcommand toggles theconcealsignal betweentrueandfalseVisual Effect: The
ReasoningPartcomponent (which renders thinking blocks) usesconceal={ctx.conceal()}to control visibility - whenconcealisfalse, thinking blocks are hiddenImplementation Details
/undo,/redo,/compact, etc./timelinein the autocomplete listsession.toggle.concealcommand that was already implemented for the "Toggle code concealment" functionalityconcealsignal that controls code concealment, which makes sense since both are about hiding/showing contentUser Experience
/thinkingto toggle thinking blocks on/offThis implementation directly addresses the GitHub issue requesting the missing
/thinkingcommand to help reduce clutter from thinking blocks in the TUI output.Closes #3641
opencode session | github run