]> git.ipfire.org Git - thirdparty/bash.git/blame - CHANGES-5.2
parse extended glob patterns in command substitutions in compatibility mode, even...
[thirdparty/bash.git] / CHANGES-5.2
CommitLineData
e9e3e4fe
CR
1This document details the changes between this version, bash-5.2-rc2, and
2the previous version, bash-5.2-rc1.
3
41. Changes to Bash
5
6a. Fixed a bug that could disable history saving after a compound array
7 assignment in an interactive shell.
8
9b. Fixed a bug that could cause incorrect error messages when running a DEBUG
10 trap during a conditional or arithmetic command.
11
12c. Fixed a bug that caused test to print an error message when given ! ! arg
13 as arguments.
14
15d. Fixed a bug that resulted in incorrect error messages when completing a
16 backquoted command substitution.
17
18e. Changed command substitution parsing to reproduce the original text more
19 closely when reconsituting the command string from the parsed command.
20
21f. Fixed a bug that could cause an EXIT trap to use the wrong variable context
22 when the errexit option is set.
23
24g. Fixed a bug that could cause the parser to incorrectly delimit a token when
25 an alias expansion ended with a multibyte character.
26
272. Changes to Readline
28
293. New Features in Bash
30
31a. Since there is no `declare -' equivalent of `local -', make sure to use
32 `local -' in the output of `local -p'.
33
34b. Null anchored matches in pattern substitution now process `&' in the
35 replacement string, like sed.
36
374. New Features in Readline
38
39------------------------------------------------------------------------------
6392d7af
CR
40This document details the changes between this version, bash-5.2-rc1, and
41the previous version, bash-5.2-beta.
42
431. Changes to Bash
44
45a. Changes to `wait -p' and how it sets the variable name in the presence of
46 valid and invalid PID arguments.
47
48b. Fixed a bug that caused compgen to dump core if the completion engine was
49 not initialized.
50
51c. Fixed a memory leak in the variable name programmable completion code.
52
53d. Here-documents and here-strings use tempfiles if the shell compatibility
54 level is 50 or lower.
55
56e. Non-interactive shells exit on a syntax error encountered while parsing a
57 command substitution.
58
59f. Fixed a bug with inherited parser state while parsing a command substitution.
60
61g. Fixed a bug that caused the shell not to check for terminating signals
62 after executing the command_string supplied with `-c' and before executing
63 the exit trap.
64
65h. Changes to avoid a make race condition while generating builtins.c.
66
67i. Make it explicit that BASH_REMATCH is always a global variable, and that
68 local copies are (currently) ignored.
69
70j. Fixed a bug that caused an ambiguous redirection (>&word) to be printed
71 incorrectly (>&word) if no file descriptor was supplied.
72
732. Changes to Readline
74
75a. Fixed a bug that caused rl_eof_found to be set prematurely while reading a
76 multi-character key sequence in callback mode.
77
783. New Features in Bash
79
80a. In posix mode, the `printf' builtin checks for the `L' length modifier and
81 uses long double for floating point conversion specifiers if it's present,
82 double otherwise.
83
84b. The `globbing' completion code now takes the `globstar' option into account.
85
86c. `suspend -f' now forces the shell to suspend even if job control is not
87 currently enabled.
88
894. New Features in Readline
90
91------------------------------------------------------------------------------
0b9a4b3a
CR
92This document details the changes between this version, bash-5.2-beta, and
93the previous version, bash-5.2-alpha.
94
951. Changes to Bash
96
97a. Fixed a problem with command-oriented history and multi-line commands that
98 caused embedded blank lines to be run together.
99
100b. Changed the way `&' is quoted when performing pattern substitution and
101 `patsub_replacement' is enabled.
102
103c. Fixed some integer overflows when expanding strings or reading the output
104 of command substitution larger than 2GB.
105
106d. `wait -p' without the `-n' option now does something useful if there are no
107 jobs.
108
109e. Fixed an issue with read timeouts in posix mode.
110
111f. Changed here-document processing to process $'...' and $"..." only when they
112 appear in the WORD portion of ${PARAM OP WORD} in the here-document body
113 and the body is being expanded.
114
115g. Changed alias expansion in command substitution to be posix-conformant
116 (performed while initially parsing the command substitution) when in posix
117 mode.
118
119h. Bash optimizes away more forks in subshells.
120
121i. Here-document construction now performs quote removal on the here-document
122 delimiter only if it's marked as quoted, which prevents quote characters in
123 command substitutions from being removed.
124
125j. Prompt string expansion now gives invisible characters in the expansion of
126 the \w, \W, and \s escape sequences a visible representation to avoid
127 problems with redisplay.
128
129k. Fixed a problem with SIGINT during the execution of a command bound with
130 `bind -x' affecting the saved terminal settings.
131
132l. Fixed an inconsistency with how $@ expands in a construct like ${@:+set}
133 or ${array[@]:+set} in the presence of null positional parameters or
134 array elements.
135
1362. Changes to Readline
137
138a. Prevent some display problems when running a command as the result of a
139 trap or one bound using `bind -x' and the command generates output.
140
141b. Fixed an issue with multi-line prompt strings that have one or more
142 invisible characters at the end of a physical line.
143
144c. Fixed an issue that caused a history line's undo list to be cleared when
145 it should not have been.
146
1473. New Features in Bash
148
149a. There is a new bindable readline command name: `vi-edit-and-execute-command'.
150
1514. New Features in Readline
152
153a. Two new bindable string variables: active-region-start-color and
154 active-region-end-color. The first sets the color used to display the
155 active region; the second turns it off. If set, these are used in place
156 of terminal standout mode.
157
158b. New readline state (RL_STATE_EOF) and application-visible variable
159 (rl_eof_found) to allow applications to detect when readline reads EOF
160 before calling the deprep-terminal hook.
161
162c. There is a new configuration option: --with-shared-termcap-library, which
163 forces linking the shared readline library with the shared termcap (or
164 curses/ncurses/termlib) library so applications don't have to do it.
165
166------------------------------------------------------------------------------
5e6f45d9
CR
167This document details the changes between this version, bash-5.2-alpha, and
168the previous version, bash-5.1-release.
169
1701. Changes to Bash
171
172a. Fixed a bug that assigned a value to the variable name supplied as an
173 argument to `wait -p' when there were no jobs.
174
175b. Fixed a bug that resulted in performing incorrect word expansion on the
176 key/value pairs in a compound array assignment.
177
178c. Fixed a bug that could put the child forked to run a command substitution
179 into the wrong process group.
180
181d. Fixed a problem that could cause the lastpipe option to work incorrectly if
182 file descriptor 0 was closed.
183
184e. Bash tries to suppress traps if a forked child receives a trapped signal
185 before it has a chance to reset its signal handlers.
186
187f. Fixed several memory leaks in compound array assignments.
188
189g. Fixed a problem with performing an assignment with `+=' to an array element
190 that was the value of a nameref.
191
192h. Fixed a bug that could cause a nameref containing an array reference using
193 `@' or `*' not to expand to multiple words.
194
195i. Fixed a bug where extended glob functions could match `.' or `..' when it
196 wasn't explicitly specified, even if dotglob was set.
197
198j. Fixed a bug that caused non-interactive posix-mode shells not to exit on a
199 variable assignment error while assigning into the temporary environment.
200
201k. Fixed a bug that caused parsing errors if an alias contained a compound
202 array assignment.
203
204l. Fixed a couple of instances where bash checked syntax too aggressively when
205 trying to determine how to add a partial command to command-oriented
206 history.
207
208m. Fixed a parser problem that caused it not to allow reserved words to follow
209 the `((' and `[[' commands.
210
211n. Fixed a bad offset calculation when using negative offsets to `history -d'.
212
213o. Fixed an off-by-one error that caused a read past the end of a buffer when
214 reading a multibyte character from the output of a command substitution.
215
216p. Fixed a problem with a failed `exec' command not setting $? to the right
217 value for an exit trap.
218
219q. Fixed a problem that caused bash not to unlink FIFOs created as part of
220 expanding redirections for an external command.
221
222r. Fixed a bug that could cause aliases not to be expanded in case statements.
223
224s. Fixed a bug that could cause word completion to attempt programmable
225 completion for the target of a redirection, instead of filename completion.
226
227t. Fixed a bug that could result in errors after rebinding a key sequence with
228 `bind -x' multiple times.
229
230u. Fixed a problem that could result in not quoting the result when performing
231 command name completion with a glob pattern in the command name.
232
233v. `mapfile' now uses fully-buffered reads in more cases, which should improve
234 bulk read performance.
235
236w. Fixed a bug that caused `wait -n' to not reset its internal state when
237 interrupted by a signal, resulting in subsequent calls failing.
238
239x. Fixed a bug with parsing numeric arguments to readline key sequences
240 installed with `bind -x'.
241
242y. Bash suppresses forking in several additional cases, including most uses
243 of $(<file).
244
245z. If there are multiple `!' tokens in a [[ command, toggle the invert state
246 instead of setting it unconditionally.
247
248aa. Fixed a bug where running `fc' on an empty history list would cause the
249 shell to crash.
250
251bb. Word completion now checks whether or not a quote character closes a
252 quoted string begun on a previous line, so readline doesn't interpret the
253 quote as starting a new quoted string.
254
255cc. Fixed a typo that translated \UNNNNNNNN characters that were not valid in
256 the current locale encoding as \uNNNNNNNN.
257
258dd. Fixed an issue that could cause bash to print timing statistics for the
259 wrong command when `set -e' causes a command to fail.
260
261ee. Bash now runs the exit trap in function context if a failed command in
262 the function causes the shell to exit.
263
264ff. Some fixes to how subshells modify $SHLVL.
265
266gg. Fixed a bug that caused `mapfile -t' not to remove the delimiter when the
267 delimiter is > 128 in the current encoding.
268
269hh. Fixed a problem that could cause the shell to attempt to free unallocated
270 memory if an expansion error occurred.
271
272ii. Fixed a bug in the bash malloc implementation of malloc_usable_size. Bash
273 did not use it, but it could cause problems with library functions that
274 did.
275
276jj. If the `exec' builtin fails, and the shell does not exit, it restores
277 trapped signals to their trapped state.
278
279kk. Fixed a bug that could cause variable assignment arguments to `declare' to
280 expand variables using attributes that the call to declare was turning off.
281
282ll. Fixed a bug with LINENO and arithmetic for commands.
283
284mm. Fixed a posix-mode bug that caused tildes not to be expanded after an
285 unquoted colon on the right side of an assignment statement.
286
287nn. Fixed a problem with `caller' and line numbers when executing an ERR trap.
288
289oo. Fixed a problem that could make the value returned by ${a:=b} not be the
290 final value assigned to a (e.g., if `a' has an attribute that modifies
291 the value on assignment).
292
293pp. Fixed a problem with saving multi-line here-documents to the history list
294 where the here-document delimiter does not appear on the first line.
295
296qq. Fixed a bug with using += to assign to dynamic variables like RANDOM.
297
298rr. Fixed a bug that caused `set -n' to modify $? if set after execution had
299 started.
300
301ss. Builtins like printf/read/wait now behave more consistently when assigning
302 arbitrary keys to associative arrays (like `]'. when appropriately quoted).
303
304tt. Fixed a problem with here-document collection printing the wrong prompt
305 when parsing a compound list in an interactive shell.
306
307uu. Fixed a problem with quoting shell expansion characters (like `$') when
308 they appear in a tab-completed word along with characters that do need
309 quoting (e.g.. $HOME/VirtualBox VMs).
310
3112. Changes to Readline
312
313a. Fixed a problem with cleaning up active marks when using callback mode.
314
315b. Fixed a problem with arithmetic comparison operators checking the version.
316
317c. Fixed a problem that could cause readline not to build on systems without
318 POSIX signal functions.
319
320d. Fixed a bug that could cause readline to crash if the application removed
321 the callback line handler before readline read all typeahead.
322
323e. Added additional checks for read errors in the middle of readline commands.
324
325f. Fixed a redisplay problem that occurred when switching from the digit-
326 argument prompt `(arg: N)' back to the regular prompt and the regular
327 prompt contained invisible characters.
328
329g. Fixed a problem with restoring the prompt when aborting an incremental
330 search.
331
332h. Fix a problem with characters > 128 not being displayed correctly in certain
333 single-byte encodings.
334
335i. Fixed a problem with unix-filename-rubout that caused it to delete too much
336 when applied to a pathname consisting only of one or more slashes.
337
338j. Fixed a display problem that caused the prompt to be wrapped incorrectly if
339 the screen changed dimensions during a call to readline() and the prompt
340 became longer than the screen width.
341
342k. Fixed a problem that caused the \r output by turning off bracketed paste
343 to overwrite the line if terminal echo was disabled.
344
345l. Fixed a bug that could cause colored-completion-prefix to not display if
346 completion-prefix-display-length was set.
347
348m. Fixed a problem with line wrapping prompts when a group of invisible
349 characters runs to the right edge of the screen and the prompt extends
350 longer then the screen width.
351
352n. Fixed a couple problems that could cause rl_end to be set incorrectly by
353 transpose-words.
354
3553. New Features in Bash
356
357a. The bash malloc returns memory that is aligned on 16-byte boundaries.
358
359b. There is a new internal timer framework used for read builtin timeouts.
360
361c. Rewrote the command substitution parsing code to call the parser recursively
362 and rebuild the command string from the parsed command. This allows better
67e47f22
CR
363 syntax checking and catches errors much earlier. Along with this, if
364 command substitution parsing completes with here-documents remaining to be
365 read, the shell prints a warning message and reads the here-document bodies
366 from the current input stream.
5e6f45d9
CR
367
368d. The `ulimit' builtin now treats an operand remaining after all of the options
369 and arguments are parsed as an argument to the last command specified by
370 an option. This is for POSIX compatibility.
371
372e. Here-document parsing now handles $'...' and $"..." quoting when reading the
373 here-document body.
374
375f. The `shell-expand-line' and `history-and-alias-expand-line' bindable readline
376 commands now understand $'...' and $"..." quoting.
377
378g. There is a new `spell-correct-word' bindable readline command to perform
379 spelling correction on the current word.
380
381h. The `unset' builtin now attempts to treat arguments as array subscripts
382 without parsing or expanding the subscript, even when `assoc_expand_once'
383 is not set.
384
385i. There is a default value for $BASH_LOADABLES_PATH in config-top.h.
386
387j. Associative array assignment and certain instances of referencing (e.g.,
98300c94 388 `test -v') now allow `@' and `*' to be used as keys.
5e6f45d9 389
98300c94
CR
390k. Bash attempts to expand indexed and associative array subscripts only
391 once when executing shell constructs and word expansions.
5e6f45d9
CR
392
393l. The `unset' builtin allows a subscript of `@' or `*' to unset a key with
394 that value for associative arrays instead of unsetting the entire array
395 (which you can still do with `unset arrayname'). For indexed arrays, it
396 removes all elements of the array without unsetting it (like `A=()').
397
398m. Additional builtins (printf/test/read/wait) do a better job of not
399 parsing array subscripts if array_expand_once is set.
400
401n. New READLINE_ARGUMENT variable set to numeric argument for readline commands
402 defined using `bind -x'.
403
404o. The new `varredir_close' shell option causes bash to automatically close
405 file descriptors opened with {var}<fn and other styles of varassign
406 redirection unless they're arguments to the `exec' builtin.
407
408p. The `$0' special parameter is now set to the name of the script when running
409 any (non-interactive) startup files such as $BASH_ENV.
410
411q. The `enable' builtin tries to load a loadable builtin using the default
412 search path if `enable name' (without any options) attempts to enable a
413 non-existent builtin.
414
415r. The `printf' builtin has a new format specifier: %Q. This acts like %q but
416 applies any specified precision to the original unquoted argument, then
417 quotes and outputs the result.
418
419s. The new `noexpand_translations' option controls whether or not the translated
420 output of $"..." is single-quoted.
421
422t. There is a new parameter transformation operator: @k. This is like @K, but
423 expands the result to separate words after word splitting.
424
425u. There is an alternate array implementation, selectable at `configure' time,
426 that optimizes access speed over memory use (use the new configure
427 --enable-alt-array-implementation option).
428
429v. If an [N]<&WORD- or [N]>&WORD- redirection has WORD expand to the empty
430 string, treat the redirection as [N]<&- or [N]>&- and close file descriptor
431 N (default 0).
432
433w. Invalid parameter transformation operators are now invalid word expansions,
434 and so cause fatal errors in non-interactive shells.
435
436x. New shell option: patsub_replacement. When enabled, a `&' in the replacement
437 string of the pattern substitution expansion is replaced by the portion of
438 the string that matched the pattern. Backslash will escape the `&' and
439 insert a literal `&'.
440
441y. `command -p' no longer looks in the hash table for the specified command.
442
443z. The new `--enable-translatable-strings' option to `configure' allows $"..."
444 support to be compiled in or out.
445
446aa. The new `globskipdots' shell option forces pathname expansion never to
447 return `.' or `..' unless explicitly matched.
448
449bb. Array references using `@' and `*' that are the value of nameref variables
450 (declare -n ref='v[@]' ; echo $ref) no longer cause the shell to exit if
451 set -u is enabled and the array (v) is unset.
452
4534. New Features in Readline
454
455a. There is now an HS_HISTORY_VERSION containing the version number of the
456 history library for applications to use.
457
458b. History expansion better understands multiple history expansions that may
459 contain strings that would ordinarily inhibit history expansion (e.g.,
460 `abc!$!$').
461
462c. There is a new framework for readline timeouts, including new public
463 functions to set timeouts and query how much time is remaining before a
464 timeout hits, and a hook function that can trigger when readline times
465 out. There is a new state value to indicate a timeout.
466
467d. Automatically bind termcap key sequences for page-up and page-down to
468 history-search-backward and history-search-forward, respectively.
469
470e. There is a new `fetch-history' bindable command that retrieves the history
471 entry corresponding to its numeric argument. Negative arguments count back
472 from the end of the history.
473
474f. `vi-undo' is now a bindable command.
475
476g. There is a new option: `enable-active-region'. This separates control of
477 the active region and bracketed-paste. It has the same default value as
478 bracketed-paste, and enabling bracketed paste enables the active region.
479 Users can now turn off the active region while leaving bracketed paste
480 enabled.
481
482h. rl_completer_word_break_characters is now `const char *' like
483 rl_basic_word_break_characters.
484
8f68f9f0 485i. Readline looks in $LS_COLORS for a custom filename extension
5e6f45d9
CR
486 (*.readline-colored-completion-prefix) and uses that as the default color
487 for the common prefix displayed when `colored-completion-prefix' is set.