keybase / keybase/client

`chat read` hard-wraps output even if stdout !isatty

Open
#17,249 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
9.2k
Forks
1.3k
Avg merge
12h 58m
Merged PRs (30d)
56

Description

The culprit appears to be here in chat_cli_rendering; it doesn't bother checking if the output is a tty and instead blindly assumes that the width of the controlling terminal is the correct width to wrap at. This doesn't match common conventions for command line programs (which should not wrap at all if stdout is not a tty) and makes it harder to automatically process the output besides (I know the JSON API exists, but for some things having the message already rendered, reactji summed up, etc is very convenient).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in go/client/chat_cli_rendering.go at the referenced rendering logic and inspect how output width is selected. Reproduce chat read with stdout redirected rather than attached to a TTY, then verify that non-TTY output is not hard-wrapped while terminal output retains its existing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.