Conversation
UMU means ∞
Review Summary by QodoAdd umu theme with comprehensive prompt styling
WalkthroughsDescription• 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 File Changes1. themes/umu/umu.theme.sh
|
Code Review by Qodo
1. Exit code uses $code
|
| function mitsuhikos_lastcommandfailed { | ||
| local status=$? | ||
| if ((status != 0)); then | ||
| _omb_util_print " ${D_DEFAULT_COLOR}C:${D_CMDFAIL_COLOR}$code ${D_DEFAULT_COLOR}" | ||
| fi |
There was a problem hiding this comment.
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
| 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}" |
There was a problem hiding this comment.
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
UMU means ∞
