Skip to content

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

Merged
merged 1 commit into from
Jul 10, 2025
Merged

Fix for 2323 issue #2326

merged 1 commit into from
Jul 10, 2025

Conversation

dracorp
Copy link
Contributor

@dracorp 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
@seefood seefood marked this pull request as ready for review July 10, 2025 19:07
@seefood seefood merged commit 4a4a0a5 into Bash-it:master Jul 10, 2025
5 of 6 checks passed
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\]'
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What do you suggest?

Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It works for me:
image
Tested on iTerm2.

Copy link
Contributor

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)).

Copy link
Contributor Author

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.

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.

3 participants