-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Fix for 2323 issue #2326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for 2323 issue #2326
Conversation
dracorp
commented
Jul 10, 2025
- fix parameter expansion for __powerline_last_status_prompt
- change ASCII code for beginning_of_line
- chane chain expansion for PROMPT
* fix parameter expansion for __powerline_last_status_prompt * change ASCII code for beginning_of_line * chane chain expansion for PROMPT
printf '%b %s %b' "$(set_color "${LAST_STATUS_THEME_PROMPT_COLOR-"52"}" -)" "${1}" "${normal?}" | ||
fi | ||
} | ||
|
||
function __powerline_prompt_command() { | ||
local last_status="$?" ## always the first | ||
local beginning_of_line='\[\e[G\]' | ||
local beginning_of_line='\[\e[B\]' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable name should be changed. \e[B
moves the cursor one line below, while \e[G
moves the cursor to the beginning of line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you suggest?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The standard name of the control function \e[B
defined in ECMA 48 is CURSOR DOWN
(and its acronym is CUU
), so cursor_down
might be one possibility.
However, I think this \e[B
doesn't work when the cursor is at the bottom of the terminal display. CUU
(i.e. \e[B
) moves the cursor only when there is another line below. When the cursor is on the last line of the terminal display CUU
(i.e. \e[B
) doesn't do anything. @dracorp Could you check the behavior at the bottom of the terminal display?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is your intention? The code you suggested seemed to have intended to put the above "Foo" and "master -> origin ..." on separate lines. However, in the above picture, they are placed on the same lines. If this is the expected behavior, actually, you should simply remove beginning_of_line
(instead of replacing it with CUD (\e[B
)).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@akinomyoga Probably you are right.
Without beginning_of_line it works in the same way.
I observed this the first time I ran rpm -q --queryformat
.