-
Notifications
You must be signed in to change notification settings - Fork 93
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
Bash 5.1 supports making PROMPT_COMMAND an array #130
Comments
FYI, in the bug-bash mailing list, there has been a discussion on how to handle the situation when there are both types of configurations that assumes the scalar if ((BASH_VERSINFO[0] > 5 || BASH_VERSINFO[0] == 5 && BASH_VERSINFO[1] >= 1)); then
PROMPT_COMMAND=${PROMPT_COMMAND-}
PROMPT_COMMAND+=("some command here")
else
# ....
fi |
I realized that Bash 5.1 The following
With this $ echo hello
hello
PRECMD
PREEXEC
$ This is because declare -a PROMPT_COMMAND=([0]=$'__bp_precmd_invoke_cmd\n__bp_interactive_mode' [1]="((++prompt_count))") so that |
@akinomyoga thanks for reporting. Any idea how prevalent an issue this is? Not sure how many people are already using bash 5.1 and using it in this fashion. Regardless, do you think this simple enough that we could just introduce a conditional in |
Now the latest releases of Linux distributions already use Bash 5.1 or 5.2, so I think many people are already using Bash 5.1 & 5.2. Nevertheless, I guess not so many Bash configurations have started to use
Currently, a small number of configurations use the array
Yes, I think so. I'll submit a PR for it (along with a suggested solution to #140). |
Was this issue indeed fixed by #141? |
This isn't strictly a bug/FR; if you feel like enabling Discussions for this repo I can repost this as a discussion
I noticed Bash 5.1 allows
PROMPT_COMMAND
to be an array:This obviously won't help older releases that bash-preexec continues to support, but it's an interesting new development we might want to utilize. It would help situations like #129 for instance.
The text was updated successfully, but these errors were encountered: