Skip to content

Comments

Add theme: umu#735

Open
UMU618 wants to merge 1 commit intoohmybash:masterfrom
UMU618:master
Open

Add theme: umu#735
UMU618 wants to merge 1 commit intoohmybash:masterfrom
UMU618:master

Conversation

@UMU618
Copy link

@UMU618 UMU618 commented Feb 19, 2026

UMU means ∞
屏幕截图 2026-02-19 225614

UMU means ∞
@qodo-free-for-open-source-projects

Review Summary by Qodo

Add umu theme with comprehensive prompt styling

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Add new "umu" theme with infinity symbol concept
• Implement comprehensive prompt styling with colors
• Support Python virtual environments and Git integration
• Include battery charge and time display features

Grey Divider

File Changes

1. themes/umu/umu.theme.sh ✨ Enhancement +141/-0

New umu theme with full prompt implementation

• New theme file implementing complete bash prompt configuration
• Defines color scheme for user, machine, directory, Git, and other elements
• Implements functions for Git branch display, directory truncation, and battery charge
• Constructs multi-line PS1 prompt with time, command status, and environment info

themes/umu/umu.theme.sh


2. themes/THEMES.md 📝 Documentation +4/-0

Document umu theme in themes list

• Add umu theme documentation entry to themes list
• Include reference to umu-dark.png preview image
• Position between tylenol and vscode themes alphabetically

themes/THEMES.md


Grey Divider

Qodo Logo

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

Code Review by Qodo

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

Grey Divider


Action required

1. Exit code uses $code 🐞 Bug ✓ Correctness
Description
mitsuhikos_lastcommandfailed stores the last status in status but prints $code (undefined), so
the failure code is blank/misleading in the prompt.
Code

themes/umu/umu.theme.sh[R44-48]

+function mitsuhikos_lastcommandfailed {
+  local status=$?
+  if ((status != 0)); then
+    _omb_util_print " ${D_DEFAULT_COLOR}C:${D_CMDFAIL_COLOR}$code ${D_DEFAULT_COLOR}"
+  fi
Evidence
The theme captures $? into status but prints $code, which is never defined in this theme. A
similar function in rana prints $status correctly.

themes/umu/umu.theme.sh[44-49]
themes/rana/rana.theme.sh[92-97]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`mitsuhikos_lastcommandfailed` prints an undefined variable (`$code`) instead of the captured exit status, so the prompt won’t display the failing command’s return code.

## Issue Context
This function is used to build `LAST_COMMAND_FAILED` for the prompt.

## Fix Focus Areas
- themes/umu/umu.theme.sh[44-49]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Battery output inside \[\] 🐞 Bug ⛯ Reliability
Description
On Linux, the theme opens a Bash non-printing escape block (\[ ... \]) and inserts
battery_charge output before closing it; since battery_charge prints visible glyphs, Bash will
miscompute prompt length leading to wrapping/cursor glitches.
Code

themes/umu/umu.theme.sh[R106-121]

+  local SAVE_CURSOR='\[\e7'
+  local RESTORE_CURSOR='\e8\]'
+  local MOVE_CURSOR_RIGHTMOST='\e['${COLUMNS:-9999}'C'
+  local MOVE_CURSOR_5_LEFT='\e[5D'
+  local THEME_CLOCK_FORMAT="%Y-%m-%dT%H:%M:%S.%N%:::z"
+  # Replace $HOME with ~ if possible
+  local RELATIVE_PWD=${PWD/#$HOME/\~}
+
+  local python_venv
+  _omb_prompt_get_python_venv
+
+  PS1=${TITLEBAR}$python_venv$'\n'
+  if [[ $OSTYPE == linux-gnu ]]; then
+    PS1+="${SAVE_CURSOR}${MOVE_CURSOR_RIGHTMOST}${MOVE_CURSOR_5_LEFT}"
+    PS1+="$(safe_battery_charge)${RESTORE_CURSOR}"
+    PS1+="${D_NUMBER_COLOR}# ${D_USER_COLOR}\u ${D_DEFAULT_COLOR}"
Evidence
SAVE_CURSOR starts a \[ block and RESTORE_CURSOR ends it with \], but
$(safe_battery_charge) is concatenated between them. The battery plugin prints visible characters
like /, which must not be inside \[\] blocks used for non-printing sequences.

themes/umu/umu.theme.sh[105-121]
plugins/battery/battery.plugin.sh[117-177]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The prompt currently wraps visible battery glyph output inside a Bash non-printing escape block (`\[ ... \]`), which breaks Bash’s prompt-width calculation and can cause wrapping/cursor positioning issues.

## Issue Context
`SAVE_CURSOR` begins `\[` but is only closed in `RESTORE_CURSOR` after battery output is appended.

## Fix Focus Areas
- themes/umu/umu.theme.sh[106-121]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

3. Clock format not overridable 🐞 Bug ✓ Correctness
Description
The theme forces a clock format every prompt render, preventing users from customizing
THEME_CLOCK_FORMAT (which clock_prompt is designed to read/configure).
Code

themes/umu/umu.theme.sh[110]

+  local THEME_CLOCK_FORMAT="%Y-%m-%dT%H:%M:%S.%N%:::z"
Evidence
clock_prompt reads THEME_CLOCK_FORMAT with a default, implying it is meant to be
user-configurable. The theme sets THEME_CLOCK_FORMAT unconditionally (as a local) each time the
prompt is built, overriding any user value.

themes/umu/umu.theme.sh[104-112]
lib/omb-prompt-base.sh[583-592]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The theme overwrites `THEME_CLOCK_FORMAT` every time the prompt renders, which prevents user customization even though `clock_prompt` explicitly supports it.

## Issue Context
`clock_prompt` uses `THEME_CLOCK_FORMAT` with a default fallback.

## Fix Focus Areas
- themes/umu/umu.theme.sh[104-112]
- lib/omb-prompt-base.sh[583-592]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

Comment on lines +44 to +48
function mitsuhikos_lastcommandfailed {
local status=$?
if ((status != 0)); then
_omb_util_print " ${D_DEFAULT_COLOR}C:${D_CMDFAIL_COLOR}$code ${D_DEFAULT_COLOR}"
fi

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

1. Exit code uses $code 🐞 Bug ✓ Correctness

mitsuhikos_lastcommandfailed stores the last status in status but prints $code (undefined), so
the failure code is blank/misleading in the prompt.
Agent Prompt
## Issue description
`mitsuhikos_lastcommandfailed` prints an undefined variable (`$code`) instead of the captured exit status, so the prompt won’t display the failing command’s return code.

## Issue Context
This function is used to build `LAST_COMMAND_FAILED` for the prompt.

## Fix Focus Areas
- themes/umu/umu.theme.sh[44-49]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +106 to +121
local SAVE_CURSOR='\[\e7'
local RESTORE_CURSOR='\e8\]'
local MOVE_CURSOR_RIGHTMOST='\e['${COLUMNS:-9999}'C'
local MOVE_CURSOR_5_LEFT='\e[5D'
local THEME_CLOCK_FORMAT="%Y-%m-%dT%H:%M:%S.%N%:::z"
# Replace $HOME with ~ if possible
local RELATIVE_PWD=${PWD/#$HOME/\~}

local python_venv
_omb_prompt_get_python_venv

PS1=${TITLEBAR}$python_venv$'\n'
if [[ $OSTYPE == linux-gnu ]]; then
PS1+="${SAVE_CURSOR}${MOVE_CURSOR_RIGHTMOST}${MOVE_CURSOR_5_LEFT}"
PS1+="$(safe_battery_charge)${RESTORE_CURSOR}"
PS1+="${D_NUMBER_COLOR}# ${D_USER_COLOR}\u ${D_DEFAULT_COLOR}"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action required

2. Battery output inside [] 🐞 Bug ⛯ Reliability

On Linux, the theme opens a Bash non-printing escape block (\[ ... \]) and inserts
battery_charge output before closing it; since battery_charge prints visible glyphs, Bash will
miscompute prompt length leading to wrapping/cursor glitches.
Agent Prompt
## Issue description
The prompt currently wraps visible battery glyph output inside a Bash non-printing escape block (`\[ ... \]`), which breaks Bash’s prompt-width calculation and can cause wrapping/cursor positioning issues.

## Issue Context
`SAVE_CURSOR` begins `\[` but is only closed in `RESTORE_CURSOR` after battery output is appended.

## Fix Focus Areas
- themes/umu/umu.theme.sh[106-121]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@UMU618 UMU618 mentioned this pull request Feb 19, 2026
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.

1 participant