mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-05 02:31:47 +00:00
fix(tui): preserve composer width on narrow panes
This commit is contained in:
parent
bbd950efcf
commit
8f0fa0836f
2 changed files with 7 additions and 7 deletions
|
|
@ -54,9 +54,9 @@ export function inputVisualHeight(value: string, columns: number) {
|
|||
}
|
||||
|
||||
export function stableComposerColumns(totalCols: number, promptWidth: number) {
|
||||
// Physical render/wrap width. Reserve:
|
||||
// - outer composer paddingX={1}: 2 columns
|
||||
// - transcript scrollbar gutter + marginLeft: 2 columns
|
||||
// - prompt prefix width
|
||||
return Math.max(1, totalCols - promptWidth - 4)
|
||||
// Physical render/wrap width. Always reserve outer composer padding and
|
||||
// prompt prefix. Only reserve the transcript scrollbar gutter when the
|
||||
// terminal is wide enough; on narrow panes, preserving input columns beats
|
||||
// keeping gutters visually aligned.
|
||||
return Math.max(1, totalCols - promptWidth - 2 - (totalCols - promptWidth >= 24 ? 2 : 0))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue