Use `command` to execute `sed`
We want our execution environment to be a predictable as possible. Similar to how we use builtin to ensure we're running the shell's builtin function (and not a redefinition), use command to ensure we're running sed and not a shell function or alias.
Some other notes:
- We could also use the
\sedsyntax if that's preferred. - It would be nice to remove this
sedcall entirely, but it looks like it might be difficult to re-implement this in "native" bash.
The motivation for this change is to avoid conflicts with (incompatible) sed aliases: https://github.com/ghostty-org/ghostty/pull/4991
- It would be nice to remove this
sedcall entirely, but it looks like it might be difficult to re-implement this in "native" bash.Actually. you could simply do
eval "local trap_argv=(${__bp_trap_string:-})" prior_trap=${trap_argv[2]}
That is much nicer! Will you create a new pull request using that approach?
You can modify this PR. I don't care about the credit about it.
You can modify this PR. I don't care about the credit about it.
I created #170 so the maintainers can compare the two approaches.
I created #170 so the maintainers can compare the two approaches.
Thanks!
@rcaloras Thanks for checking and merging PRs! Now that #170 is merged, this PR (which implements an alternative approach to #170) can be closed.