Use a function substitution in $PS0 for preexec in Bash >= 5.3#166
Use a function substitution in $PS0 for preexec in Bash >= 5.3#166akinomyoga wants to merge 4 commits intorcaloras:masterfrom
$PS0 for preexec in Bash >= 5.3#166Conversation
$PS0 and function substitution in Bash >= 5.3$PS0 for preexec in Bash >= 5.3
47d841d to
a391713
Compare
* Do not prefix local varnames with underscores
* Make "__bp_invoke_pre{cmd,exec}_functions" return the last non-zero exit status
* Test "__bp_invoke_pre{cmd,exec}_functions"
|
Bash 5.3 has been out for about six months, and sourcing bash-preexec from this PR works for me with atuin. @akinomyoga anything to add other than a rebase? @rcaloras would you be able to take a look? |
No. |
|
On reflection, @rcaloras what do you think about bringing on @akinomyoga as a collaborator with merge permissions (assuming he is amenable to it, of course)? Based on his recent work in bash-preexec, atuin’s Bash integration, ble.sh, bash-completion, and oils (a promising Bash-compatible shell), he seems like an excellent candidate. No affiliation, just an appreciative user! |
|
If @rcaloras is comfortable with it, I can be a collaborator, but I'm not sure if that actually changes the situation. It depends on the goal of this project and what kind of role and discretion in the project would be given to me as a collaborator. Even if I become a collaborator, @rcaloras makes the final decisions on the design and the direction of the project. If the project goal is to show the simplest implementation compromising stability and robustness (as guessed from past replies), any changes that increase the number of lines of code would never be adopted, even if it solves real problems. |
Ah, thanks for the context. Based on the tastes I’ve observed in your comments and commit messages here and elsewhere, if you were to maintain a fork, I’d certainly adopt it. I’m already using the version from this branch, but I don’t think there’s one branch integrating the various other patches you and others have submitted. It would be great if Ryan is open to collaborate, since forks have low visibility and have to build reputation mostly from scratch. But that’s how FOSS works sometimes! |
This implements the approach to preexec using a function substitution in PS0 mentioned in #28 (comment). This should solve the issues #164 (subshells), #6 (function definitions), #158 (comments),
#147 (custom HISTIGNORE/HISTCONTROL)in Bash 5.3 (which is now under the beta testing). It should be noted that this doesn't change the situation in Bash <= 5.2.edit: The issue with
HISTIGNOREandHISTCONTROLisn't solved by this PR.