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