Skip to content

Hardcoded 120-column max width ignores large terminals #595

Description

@zhaider3c

Summary

useTerminalWidth caps content width to 120 columns regardless of terminal size, leaving most of a wide terminal empty.

Location

source/hooks/useTerminalWidth.ts (compiled to dist/hooks/useTerminalWidth.js):

const calculateBoxWidth = (columns) => Math.max(Math.min(columns - 4, 120), 40);

Also source/constants.ts sets DEFAULT_TERMINAL_WIDTH = 120 — unclear whether this was intended as a cap or just a fallback.

Impact

On a 190-column terminal, usable width is clamped to ~116 (120 − 4 padding), wasting ~74 columns of horizontal space. Forces users to either:

  • Resize their terminal smaller, or
  • Patch the dist file after every npm update

Suggested fix

  • Use the full terminal width as the max (or make it configurable)
  • At minimum remove the Math.min(columns - 4, 120) cap so it respects actual terminal width
  • Or expose a setting in nanocoder-preferences.json / agents.config.json for max-width

Workaround

sed -i "s/min(columns - 4, 120)/min(columns - 4, 999)/" \
  "$NVM_DIR/versions/node/$(ls -1 "$NVM_DIR/versions/node" | tail -1)/lib/node_modules/@nanocollective/nanocoder/dist/hooks/useTerminalWidth.js"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions