Skip to content

trycmd should normalise some env vars including COLUMNS #361

Open
@ijackson

Description

@ijackson

Steps

git clone https://gitlab.torproject.org/tpo/core/arti.git
cd arti
git checkout  5e2d5532d002c9df9a4cf6d83cdbe7d6125bc4be
COLUMNS=100 cargo test --locked --offline -p arti --all-features -- cli_tests
COLUMNS=1000 cargo test --locked --offline -p arti --all-features -- cli_tests

Expected output

  1. Successful run
  2. Successful run

Actual output

  1. Successful run
  2. Report of differences, apparently due to line wrapping

Discussion

Programs using clap, and many similar, may pay attention to COLUMNS.

Probably, the variable should be set rather than left unset. After, all, a conscientious program which finds it has no COLUMNS might fall back on interrogating the tty with termios ioctls.

There may be other relevant env vars. Maybe grepping the source code to clap would be helpful. It would also be nice if the API had a way to pass additional env vars as a workaround.

(edited to correct the wrong git commitid)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-trycmdArea: trycmd packageenhancementImprove the expectedquestionUncertainty is involved

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions