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