fix(bash): work around custom IFS #1514
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When the user sets a custom value of
IFS
, the up keybinding may fail because the option--shell-up-key-binding
passed to__atuin_history
is broken by the word splitting of the shell. For example, when the user setsIFS=-
,atuin
called from__atuin_history
receivesshell up key binding <content>
as the search string.Note that the problem only happens with the plain Bash without ble.sh. The problem does not arise within ble.sh because ble.sh separates the user environment and the line-editor environment by saving/restoring the shell settings. The keybindings are processed in the line-editor environment in ble.sh, so the custom
IFS
set by the user does not affect it.In this patch, we properly quote the arguments to the
atuin
command.