fix: prevent install script failure with TERM=dumb in minimal terminals#4928
Merged
Conversation
Add tput capability check to prevent script from exiting when TERM=dumb or other minimal terminals are used. The script now tests if tput can actually execute successfully before attempting to set color variables. Fixes issue where install script would fail silently in minimal terminals commonly used in Docker images (e.g., CircleCI images). Co-authored-by: markphelps <[email protected]>
Copilot
AI
changed the title
[WIP] Fix install script for minimal terminal environments
fix: prevent install script failure with TERM=dumb in minimal terminals
Oct 22, 2025
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v2 #4928 +/- ##
=======================================
Coverage 59.01% 59.01%
=======================================
Files 135 135
Lines 16874 16874
=======================================
Hits 9959 9959
Misses 6234 6234
Partials 681 681
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
erka
approved these changes
Oct 22, 2025
markphelps
marked this pull request as ready for review
October 22, 2025 16:45
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The install script failed silently when run in minimal terminal environments (e.g.,
TERM=dumb) commonly used in Docker images like CircleCI. Users would see no output and the script would exit with code 1:Root Cause
The script uses
set -eto exit on any command failure. The color detection logic checked iftputexists and if stdout is a terminal, but didn't verify thattputcan actually work with the currentTERMvalue:When
TERM=dumb, thetput setaf 1command fails because the "dumb" terminal type doesn't support color capabilities, causing the entire script to exit immediately due toset -e.Solution
Added a capability check to verify
tputcan actually execute successfully before attempting to set color variables:The additional
&& tput setaf 1 >/dev/null 2>&1check ensurestputcan work with the current terminal before proceeding.Testing
Verified the fix works correctly with:
TERM=dumb(the main issue scenario) ✓TERM=xterm(normal terminal) ✓TERMunset ✓cat install.sh | TERM=dumb sh) ✓The script now produces output and runs successfully in all terminal environments tested.
Fixes issue where
curl -fsSL https://get.flipt.io/v2 | shwould fail silently in minimal Docker environments.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
download.flipt.iocurl -fsSL -o /tmp/flipt.tar.gz REDACTED(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
Fixes #4927
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.