Overloading cd with function that outputs text breaks default YASH_PS1R prompt
Found while answering a Unix&Linux question: https://unix.stackexchange.com/a/625232/116858
Fixed in r4159
Some completion scripts will still break with a user-defined cd function. I don't think such a function is very useful in yash.
Thanks
If one creates a cd function like so:
while running yash with no .yashrc or .yash_profile file, then the call to cd -P .. in the _update_vcs_info function will cause YASH_PS1R to be set to data outputted by the custom cd function.
To fix this, do command cd -P .. or command -b cd -P .. in the _update_vcs_info function in share/initialization/common to avoid calling a user-supplied function.
This have been observed in yash 2.49 (default on OpenBSD), 2.50, and 2.51, but may have been present before 2.49 too.