Opened 13 days ago
Closed 12 days ago
#19195 closed bug (fixed)
hrev58270 broke my bash prompt
Reported by: | bipolar | Owned by: | korli |
---|---|---|---|
Priority: | blocker | Milestone: | R1/beta6 |
Component: | System/Kernel | Version: | R1/beta5 |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
For the last couple of years I have been using the following prompt on my bash profile:
function _git_prompt { local __prev_rc_and_loc='\[`if [ $? = 0 ]; then echo "\e[32m"; else echo "\e[31m"; fi`\]\w\[\e[0m\]' local __git_branch_color="\[\033[31m\]" local __git_branch='`git branch 2> /dev/null | grep -e ^*| sed -E s/^\\\\\*\ \(.+\)$/\(\\\\\1\)\/`' local __last_color="\[\033[00m\]" export PS1="[$__prev_rc_and_loc $__git_branch_color$__git_branch$__last_color]\n> " } _git_prompt
Till hrev58228 in 64 bits (and till hrev58265 on 32 bits), it worked just fine.
But after updating to hrev58270, everytime I open a new Terminal (and after each command issued, of course) now I get:
sed: read error on stdin: Operation would block grep: (standard input): Operation would block grep: (standard input): Operation would block
Change History (10)
comment:1 by , 13 days ago
comment:2 by , 13 days ago
Summary: | hrev57270 broke my bash prompt → hrev58270 broke my bash prompt |
---|
comment:3 by , 13 days ago
Seems it also broke my inrecipe()
bash function:
function inrecipe { find "$HP_REPO_LOCATION" -maxdepth 3 \ -type d \(-path "$HP_REPO_LOCATION"/repository -o \ -path "$HP_REPO_LOCATION"/packages \) \ -prune -o \ -name "*-*.recipe" -print | xargs grep -ni --col "$1"; return 0 }
As it now gives:
xargs: errno-buffer safe_read failed in xargs_do_exec (this is probably a bug, please report it): Operation would block xargs: error closing file
Before showing the same sed/grep error due to the broken prompt.
follow-up: 5 comment:4 by , 13 days ago
I also wanted to report this, but you were faster than me ;)
There are more symptoms though:
The standard Haiku prompt (coloring based on exit status) is also broken, it is just black. Navigating through the history with arrow keys sometimes deletes part of the prompt.
$(getarch)
expands to an empty string (noticed when I wanted to bisect this problem via https://www.haiku-os.org/guides/daily-tasks/updating-system)
and worst of all (for me): haikuporter is broken. It just prints:
'finddir B_USER_CONFIG_DIRECTORY' failed. Error: Can't evaluate config file: /boot/home/config/settings/haikuports.conf cut: -: Operation would block
(the third line not always and sometimes after the prompt returned). directly calling finddir
works though.
hrev58265 still works. The others in between aren't available as updates.
comment:5 by , 13 days ago
Replying to jmairboeck:
The standard Haiku prompt (coloring based on exit status) is also broken, it is just black. Navigating through the history with arrow keys sometimes deletes part of the prompt.
Note that this isn't a Terminal problem, it also doesn't work in Konsole (KF6 version). I tried that too.
comment:6 by , 13 days ago
Component: | - General → System/Kernel |
---|---|
Milestone: | Unscheduled → R1/beta6 |
Owner: | changed from | to
Priority: | normal → blocker |
Status: | new → assigned |
comment:7 by , 13 days ago
Seems we don't reset O_NONBLOCK correctly.
Using an unused bit in https://review.haiku-os.org/c/haiku/+/8497
I don't have a better idea ATM.
Mistyped the hrev number on the title/summary. Maintainers, please edit to 58270. Thanks.