Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to force terminal-style output even when redirected #4146

Merged
merged 2 commits into from Aug 23, 2021
Merged

Conversation

@mislav
Copy link
Member

@mislav mislav commented Aug 17, 2021

Allows terminal-style output to be piped to a file or a script. Color will be enabled unless explicitly disabled with one of the color-controlling environment variables.

Optionally allows to specify the number of available columns as an absolute number or as a percentage of the current viewport.

Fixes #4035

Example:

GH_FORCE_TTY=49% gh issue list | fzf --ansi --preview 'GH_FORCE_TTY=$FZF_PREVIEW_COLUMNS gh issue view {1}'

Questions:

  • How does the "GH_FORCE_TTY" name sound?
@cliAutomation cliAutomation added this to Needs review 🤔 in The GitHub CLI Aug 17, 2021
Copy link
Member

@vilmibm vilmibm left a comment

I am cool with the name for this and love the feature; I definitely want some unit tests though since there is subtle logic in how we parse the three forms of the value.

@mislav mislav requested a review from vilmibm Aug 23, 2021
The GitHub CLI automation moved this from Needs review 🤔 to Needs to be merged 🎉 Aug 23, 2021
@mislav mislav merged commit af2aecd into trunk Aug 23, 2021
13 checks passed
13 checks passed
@github-actions
CodeQL-Build
Details
@github-actions
CodeQL-Build
Details
@github-actions
lint
Details
@github-actions
lint
Details
@github-actions
build (ubuntu-latest)
Details
@github-actions
build (ubuntu-latest)
Details
@github-actions
build (windows-latest)
Details
@github-actions
build (windows-latest)
Details
@github-actions
build (macos-latest)
Details
@github-actions
build (macos-latest)
Details
@github-actions
build-minimum
Details
@github-actions
build-minimum
Details
@github-code-scanning
CodeQL No new or fixed alerts
Details
The GitHub CLI automation moved this from Needs to be merged 🎉 to Pending Release 🥚 Aug 23, 2021
@mislav mislav deleted the force-tty branch Aug 23, 2021
@github-actions github-actions bot moved this from Pending Release 🥚 to Done 💤 in The GitHub CLI Aug 24, 2021
@Gemk83
Gemk83 approved these changes Aug 30, 2021
The GitHub CLI automation moved this from Done 💤 to Needs to be merged 🎉 Aug 30, 2021
@aliscco

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
The GitHub CLI
  
Needs to be merged 🎉
Linked issues

Successfully merging this pull request may close these issues.

4 participants