Summary
The kanban board skill template (commands/board.md) manually passes --width $(tput cols) to kanban-display.ts. This is redundant — the display tool already auto-detects terminal width via process.stdout.columns and $COLUMNS env var (in lib/table.ts:termW()). The --width override should be removed from the skill template.
Problem
-
Redundant --width flag in skill template — The board.md command template includes:
TERM_WIDTH=$(tput cols 2>/dev/null || echo 80)
bun run .../kanban-display.ts board ... --width "$TERM_WIDTH"
But kanban-display.ts already calls termW() which checks process.stdout.columns → $COLUMNS → defaults to 80. The manual tput cols is doing the same work.
-
When run from Claude Code's Bash tool, process.stdout is not a TTY, so process.stdout.columns is undefined. The tool falls back to $COLUMNS or 80. The tput cols workaround compensates, but the real fix should be in the tool itself.
-
Width mismatch causes rendering issues — When the passed width doesn't match the actual display context (e.g., Claude Code output stream, headless tmux panes, piped output), the board draws cards and banners that wrap or clip incorrectly.
Proposed Fix
In kanban-display.ts (or lib/table.ts:termW()):
- Add
$COLUMNS detection earlier in the chain (already done ✓)
- When invoked from a non-TTY context, try to inherit
$COLUMNS from the parent shell
- Consider a slightly wider default (e.g., 100) for non-TTY contexts, since most terminals today are wider than 80
In commands/board.md:
- Remove the
TERM_WIDTH and --width lines from the bash template
- Let the display tool handle its own width detection
- If a workaround is still needed for non-TTY, set
COLUMNS env var instead:
COLUMNS=$(tput cols 2>/dev/null || echo 80) bun run .../kanban-display.ts board ...
This is cleaner because termW() already reads $COLUMNS.
Environment
- Plugin: kanban 1.2.0
- File:
tools/kanban-display.ts lines 58-62, 914, 924-935
- File:
commands/board.md
- File:
lib/table.ts line 58-62
Related
The termW() function in lib/table.ts:
export function termW(): number {
return process.stdout.columns
|| (process.env.COLUMNS ? parseInt(process.env.COLUMNS) : 0)
|| 80;
}
This already supports $COLUMNS — the skill template just needs to export it instead of using --width.
Summary
The kanban board skill template (
commands/board.md) manually passes--width $(tput cols)tokanban-display.ts. This is redundant — the display tool already auto-detects terminal width viaprocess.stdout.columnsand$COLUMNSenv var (inlib/table.ts:termW()). The--widthoverride should be removed from the skill template.Problem
Redundant
--widthflag in skill template — Theboard.mdcommand template includes:But
kanban-display.tsalready callstermW()which checksprocess.stdout.columns→$COLUMNS→ defaults to 80. The manualtput colsis doing the same work.When run from Claude Code's Bash tool,
process.stdoutis not a TTY, soprocess.stdout.columnsisundefined. The tool falls back to$COLUMNSor 80. Thetput colsworkaround compensates, but the real fix should be in the tool itself.Width mismatch causes rendering issues — When the passed width doesn't match the actual display context (e.g., Claude Code output stream, headless tmux panes, piped output), the board draws cards and banners that wrap or clip incorrectly.
Proposed Fix
In
kanban-display.ts(orlib/table.ts:termW()):$COLUMNSdetection earlier in the chain (already done ✓)$COLUMNSfrom the parent shellIn
commands/board.md:TERM_WIDTHand--widthlines from the bash templateCOLUMNSenv var instead:COLUMNS=$(tput cols 2>/dev/null || echo 80) bun run .../kanban-display.ts board ...termW()already reads$COLUMNS.Environment
tools/kanban-display.tslines 58-62, 914, 924-935commands/board.mdlib/table.tsline 58-62Related
The
termW()function inlib/table.ts:This already supports
$COLUMNS— the skill template just needs to export it instead of using--width.