Skip to content

feat(tui): make prompt size responsive and configurable#28255

Merged
rekram1-node merged 1 commit into
anomalyco:devfrom
bjschafer:bschafer/tui-prompt-size
May 25, 2026
Merged

feat(tui): make prompt size responsive and configurable#28255
rekram1-node merged 1 commit into
anomalyco:devfrom
bjschafer:bschafer/tui-prompt-size

Conversation

@bjschafer
Copy link
Copy Markdown
Contributor

@bjschafer bjschafer commented May 18, 2026

Issue for this PR

Related to #14670

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

  • Makes the TUI prompt height configurable via tui.json (setting prompt.max_height) instead of being hard-capped at 6 lines.
  • Lets the prompt textarea fill its parent width via tui.json (setting prompt.max_width) for users who want a wider/responsive prompt. This is opt-in via config.

To enable responsive width, add to tui.json:

{
    "prompt": {
        "max_width": "auto",
        "max_height": "auto"
    }
}

auto for prompt.max_width resolves to max(75, floor(terminal_width * 0.7)), or you can set a fixed numeric value.

How did you verify your code works?

  • bun --cwd packages/opencode typecheck
  • git diff --check
  • pre-push hook: bun turbo typecheck

Screenshots / recordings

image

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label May 18, 2026
@github-actions
Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

The only relevant result found is PR #28255 itself (the current PR), which is expected. The other result (#13885) is about a native status line template system and is not related to this prompt sizing feature.

No duplicate PRs found

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label May 18, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@bjschafer bjschafer force-pushed the bschafer/tui-prompt-size branch from a02ffc8 to be3306c Compare May 19, 2026 20:17
@rekram1-node
Copy link
Copy Markdown
Collaborator

I think this introduces a regression for the prompt input width, now it is much wider which is a change from our existing styling

@bjschafer
Copy link
Copy Markdown
Contributor Author

I think this introduces a regression for the prompt input width, now it is much wider which is a change from our existing styling

The wider prompt is intentional, that's the core change this PR makes (along with allowing it to grow longer as well). The goal is for the prompt to grow within reasonable bounds with the terminal rather than staying capped at a fairly narrow width. The behavior is configurable as well.

Happy to clarify anything about the approach if it's helpful.

@bjschafer bjschafer force-pushed the bschafer/tui-prompt-size branch from be3306c to 590b520 Compare May 21, 2026 17:03
@rekram1-node
Copy link
Copy Markdown
Collaborator

Screenshot 2026-05-21 at 9 26 04 PM

@rekram1-node
Copy link
Copy Markdown
Collaborator

Screenshot 2026-05-21 at 9 26 35 PM

@rekram1-node
Copy link
Copy Markdown
Collaborator

That first option (what this PR does) looks pretty ugly to me, ill check w/ team.

I'm totally game for making the box configurable but i dont think we should be changing the default size to this

@rekram1-node
Copy link
Copy Markdown
Collaborator

Yeah talked w/ team we don't want to change the default behaviors here

@bjschafer
Copy link
Copy Markdown
Contributor Author

would you be open to adding the adaptive width behind an option in tui.json instead?

and, any concerns with the expanded vertical space also in this PR?

@rekram1-node
Copy link
Copy Markdown
Collaborator

i think the vertical spacing one is prolly fine

@bjschafer bjschafer force-pushed the bschafer/tui-prompt-size branch from 590b520 to 8b8e874 Compare May 22, 2026 17:08
@bjschafer
Copy link
Copy Markdown
Contributor Author

Ok, left vertical spacing as-is in this change. Updated horizontal to not change the default behavior but instead provide an opt-in in tui.json like so:

{
  "prompt": {
    "max_width": "auto"
  }
}
// Resolves to max(75, floor(terminal_width * 0.7)).

or "auto" can instead be a fixed width.

@rekram1-node
Copy link
Copy Markdown
Collaborator

/review

Comment thread packages/opencode/src/cli/cmd/tui/routes/home.tsx
@bjschafer bjschafer requested a review from rekram1-node May 23, 2026 20:16
@rekram1-node rekram1-node merged commit 0de5f1f into anomalyco:dev May 25, 2026
12 checks passed
HaleTom pushed a commit to HaleTom/opencode that referenced this pull request May 25, 2026
@bjschafer bjschafer deleted the bschafer/tui-prompt-size branch May 26, 2026 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants