Skip to content

fix(themes/powerline): restore POWERLINE_PROMPT_FOREGROUND_COLOR support#2384

Open
seefood wants to merge 3 commits intoBash-it:masterfrom
seefood:fix/2374-powerline-foreground-color
Open

fix(themes/powerline): restore POWERLINE_PROMPT_FOREGROUND_COLOR support#2384
seefood wants to merge 3 commits intoBash-it:masterfrom
seefood:fix/2374-powerline-foreground-color

Conversation

@seefood
Copy link
Copy Markdown
Contributor

@seefood seefood commented Apr 18, 2026

Summary

  • Restores POWERLINE_PROMPT_FOREGROUND_COLOR support in powerline and powerline-plain themes
  • The cleanup in All themes cleaned up #2360 overwrote the fix originally introduced in Add support to powerline themes to override foreground color #2231, reverting set_color "${POWERLINE_PROMPT_FOREGROUND_COLOR}" back to set_color - (no foreground color)
  • Uses ${POWERLINE_PROMPT_FOREGROUND_COLOR:--} so the default is - (terminal default fg, same as before) and the variable is only applied when explicitly set — prevents passing an empty string to set_color which would generate a broken ANSI escape

Test plan

  • Set export POWERLINE_PROMPT_FOREGROUND_COLOR=15 and verify bright-white foreground is applied across all powerline segments
  • Unset POWERLINE_PROMPT_FOREGROUND_COLOR and verify prompt renders identically to before (no regression)
  • Verify powerline-plain theme has the same behaviour

Fixes #2374

🤖 Generated with Claude Code

seefood and others added 2 commits April 18, 2026 18:39
The cleanup in Bash-it#2360 overwrote the fix from Bash-it#2231, causing
POWERLINE_PROMPT_FOREGROUND_COLOR to be ignored. Restore the variable
with a safe default of '-' (no override) so existing setups are
unaffected while still allowing foreground color customization.

Fixes Bash-it#2374

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…D_COLOR

Covers the regression from Bash-it#2374: verifies that the fg color code is
absent when the variable is unset and present when it is set.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Comment thread test/themes/powerline.base.bats Fixed
Comment thread test/themes/powerline.base.bats Fixed
Comment thread test/themes/powerline.base.bats Fixed
…bles

Variables like SEGMENTS_AT_LEFT, LAST_SEGMENT_COLOR, and
POWERLINE_PROMPT_FOREGROUND_COLOR are assigned in test setup/body and
read by the loaded powerline functions; shellcheck can't see that cross-
file usage and emits false-positive SC2034 warnings.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: #2360 reverted #2231

2 participants