Ticket #41063

Overloading cd with function that outputs text breaks default YASH_PS1R prompt

오픈 날짜: 2020-12-20 03:29 마지막 업데이트: 2020-12-21 22:56

Reporter:
소유자:
Type:
Status:
Closed
Component:
MileStone:
(None)
Priority:
5 - Medium
Severity:
5 - Medium
Resolution:
Fixed
File:
None
Vote
Score: 0
No votes
0.0% (0/0)
0.0% (0/0)

Details

If one creates a cd function like so:

cd () { command cd "$@"; echo "$PWD"; }

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.

Ticket History (3/3 Histories)

2020-12-20 03:29 Updated by: kusalananda
  • New Ticket "Overloading cd with function that outputs text breaks default YASH_PS1R prompt" created
2020-12-20 03:33 Updated by: kusalananda
댓글 올리기

Found while answering a Unix&Linux question: https://unix.stackexchange.com/a/625232/116858

2020-12-21 22:56 Updated by: magicant
  • Resolution Update from None to Fixed
  • Status Update from Open to Closed
댓글 올리기

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

Attachment File List

No attachments

Edit

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Login