Skip to content

themes/duru: fix undefined ${gray} in venv prompt - #774

Merged
akinomyoga merged 1 commit into
ohmybash:masterfrom
koppor:duru-gray-fix
Aug 21, 2026
Merged

akinomyoga merged 1 commit into
ohmybash:masterfrom
koppor:duru-gray-fix

Conversation

@koppor

@koppor koppor commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

The venv function in the duru theme colors the " in " text with ${gray}, but gray is never defined: the color variables are all _omb_prompt_* (lib/omb-prompt-colors.sh), and plain gray is not among the deprecated compatibility names either (black, cyan, white, orange and the bold_*/underline_*/background_* variants are). The variable expands to empty, so the text renders in whatever color was active before instead of gray.

Use ${_omb_prompt_gray}, matching the _omb_prompt_red already used on the next segment.

Noticed while porting duru to a custom theme.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SABAE23V7T3PvYht4QmG9j

${gray} is never defined by oh-my-bash (the color variables are
_omb_prompt_*, and plain 'gray' is not among the deprecated
compatibility names), so the " in " before the virtualenv name
rendered uncolored. Use ${_omb_prompt_gray}.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SABAE23V7T3PvYht4QmG9j
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

themes/duru: Fix undefined gray color in venv prompt

🐞 Bug fix 🕐 Less than 5 minutes

Grey Divider

AI Description

• Fix venv prompt segment to use a defined gray color variable.
• Ensure " in " renders consistently gray before the virtualenv name.
Diagram

graph TD
  A["Shell prompt"] --> B["duru.theme.sh"] --> C["venv()"] --> D{"VIRTUAL_ENV set?"}
  D -->|"yes"| E["Print: gray ' in ' + red env"]
  D -->|"no"| F["Print nothing"]
  subgraph Legend
    direction LR
    _proc["Process"] ~~~ _dec{"Decision"}
  end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Add a global 'gray' compatibility alias
  • ➕ Avoids touching individual themes that may reference ${gray}
  • ➕ Improves backward compatibility for third-party themes
  • ➖ Expands the deprecated compatibility surface area
  • ➖ May mask similar issues rather than fixing them at the source

Recommendation: The PR's approach is best for this case: duru should use the supported omb_prompt* variables directly, matching existing theme style (_omb_prompt_red). A global 'gray' alias could be considered separately as a broader compatibility policy decision.

Files changed (1) +1 / -1

Bug fix (1) +1 / -1
duru.theme.shUse _omb_prompt_gray for venv segment coloring +1/-1

Use _omb_prompt_gray for venv segment coloring

• Replaces an undefined ${gray} reference with ${_omb_prompt_gray} when printing the " in " text before the virtualenv name. This ensures the segment consistently renders in gray rather than inheriting the previous color.

themes/duru/duru.theme.sh

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can tweak Display preferences with a live preview to see your comment before it ships

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@akinomyoga

Copy link
Copy Markdown
Contributor

Thank you for the report. I've checked the history, but it seems to have been broken since the beginning when the setting was introduced in e65c390.

@akinomyoga
akinomyoga merged commit 8d7c836 into ohmybash:master Aug 21, 2026
4 checks passed
@koppor
koppor deleted the duru-gray-fix branch August 21, 2026 14:21
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.

2 participants