modify way bash avoids running traps in subshells that haven't reset the trap strings yet; new readline bindable command 'shell-expand-and-requote-line'

This commit is contained in:
Chet Ramey
2026-01-14 11:08:22 -05:00
parent e7c3acf108
commit a6421d8419
13 changed files with 194 additions and 50 deletions
+23 -3
View File
@@ -2065,13 +2065,33 @@ If a numeric argument is supplied, append a @samp{*} before
pathname expansion.
@item shell-expand-line (M-C-e)
Expand the line by performing shell word expansions.
Expand the line by performing shell word expansions,
treating the line as a single shell word.
This performs alias and history expansion,
$'@var{string}' and $"@var{string}" quoting,
tilde expansion, parameter and variable expansion, arithmetic expansion,
command and process substitution,
word splitting, and quote removal.
An explicit argument suppresses command and process substitution.
word splitting, and quote removal.
An explicit argument suppresses command and process substitution and
treats the line as if it were quoted as part of a here-document.
@item shell-expand-and-requote-line ()
Expand the line by performing shell word expansions,
splitting the line into shell words in the same way as for
programmable completion.
This performs alias and history expansion,
$'@var{string}' and $"@var{string}" quoting,
tilde expansion, parameter and variable expansion, arithmetic expansion,
command and process substitution,
word splitting, and quote removal
on each word, then quotes the resulting words if necessary to
prevent further expansion.
An explicit argument suppresses command and process substitution
and quotes each resultant word.
As usual, double-quoting a word will suppress word splitting.
This can be useful when combined with suppressing command substitution,
for instance, so the words in the command substitution aren't
quoted individually.
@item history-expand-line (M-^)
Perform history expansion on the current line.