-
Notifications
You must be signed in to change notification settings - Fork 182
/
CHANGES
10858 lines (7293 loc) · 427 KB
/
CHANGES
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
This document details the changes between this version, bash-5.2-release, and
the previous version, bash-5.2-rc4.
1. Changes to Bash
2. Changes to Readline
a. When replacing a history entry, make sure the existing entry has a non-NULL
timestamp before copying it; it may have been added by the application, not
the history library.
3. New Features in Bash
4. New Features in Readline
------------------------------------------------------------------------------
This document details the changes between this version, bash-5.2-rc4, and
the previous version, bash-5.2-rc3.
1. Changes to Bash
a. Changed how the compatibility mode enabling of extglob works in conjunction
with parsing conditional commands.
b. Fixed a problem with aliases containing command substitutions.
2. Changes to Readline
3. New Features in Bash
4. New Features in Readline
------------------------------------------------------------------------------
This document details the changes between this version, bash-5.2-rc3, and
the previous version, bash-5.2-rc2.
1. Changes to Bash
a. Added a compatibility mode feature that causes the parser to parse command
substitutions as if extglob were enabled. If it is enabled before execution,
parse at execution will succeed. If not, the subsequent execution parse will
fail.
b. Fixed an issue with handling a `return' executed in a trap action if the
trap is executed while running in a shell function.
2. Changes to Readline
3. New Features in Bash
4. New Features in Readline
a. Readline now checks for changes to locale settings (LC_ALL/LC_CTYPE/LANG)
each time it is called, and modifies the appropriate locale-specific display
and key binding variables when the locale changes.
------------------------------------------------------------------------------
This document details the changes between this version, bash-5.2-rc2, and
the previous version, bash-5.2-rc1.
1. Changes to Bash
a. Fixed a bug that could disable history saving after a compound array
assignment in an interactive shell.
b. Fixed a bug that could cause incorrect error messages when running a DEBUG
trap during a conditional or arithmetic command.
c. Fixed a bug that caused test to print an error message when given ! ! arg
as arguments.
d. Fixed a bug that resulted in incorrect error messages when completing a
backquoted command substitution.
e. Changed command substitution parsing to reproduce the original text more
closely when reconsituting the command string from the parsed command.
f. Fixed a bug that could cause an EXIT trap to use the wrong variable context
when the errexit option is set.
g. Fixed a bug that could cause the parser to incorrectly delimit a token when
an alias expansion ended with a multibyte character.
2. Changes to Readline
3. New Features in Bash
a. Since there is no `declare -' equivalent of `local -', make sure to use
`local -' in the output of `local -p'.
b. Null anchored matches in pattern substitution now process `&' in the
replacement string, like sed.
4. New Features in Readline
------------------------------------------------------------------------------
This document details the changes between this version, bash-5.2-rc1, and
the previous version, bash-5.2-beta.
1. Changes to Bash
a. Changes to `wait -p' and how it sets the variable name in the presence of
valid and invalid PID arguments.
b. Fixed a bug that caused compgen to dump core if the completion engine was
not initialized.
c. Fixed a memory leak in the variable name programmable completion code.
d. Here-documents and here-strings use tempfiles if the shell compatibility
level is 50 or lower.
e. Non-interactive shells exit on a syntax error encountered while parsing a
command substitution.
f. Fixed a bug with inherited parser state while parsing a command substitution.
g. Fixed a bug that caused the shell not to check for terminating signals
after executing the command_string supplied with `-c' and before executing
the exit trap.
h. Changes to avoid a make race condition while generating builtins.c.
i. Make it explicit that BASH_REMATCH is always a global variable, and that
local copies are (currently) ignored.
j. Fixed a bug that caused an ambiguous redirection (>&word) to be printed
incorrectly (>&word) if no file descriptor was supplied.
2. Changes to Readline
a. Fixed a bug that caused rl_eof_found to be set prematurely while reading a
multi-character key sequence in callback mode.
3. New Features in Bash
a. In posix mode, the `printf' builtin checks for the `L' length modifier and
uses long double for floating point conversion specifiers if it's present,
double otherwise.
b. The `globbing' completion code now takes the `globstar' option into account.
c. `suspend -f' now forces the shell to suspend even if job control is not
currently enabled.
4. New Features in Readline
------------------------------------------------------------------------------
This document details the changes between this version, bash-5.2-beta, and
the previous version, bash-5.2-alpha.
1. Changes to Bash
a. Fixed a problem with command-oriented history and multi-line commands that
caused embedded blank lines to be run together.
b. Changed the way `&' is quoted when performing pattern substitution and
`patsub_replacement' is enabled.
c. Fixed some integer overflows when expanding strings or reading the output
of command substitution larger than 2GB.
d. `wait -p' without the `-n' option now does something useful if there are no
jobs.
e. Fixed an issue with read timeouts in posix mode.
f. Changed here-document processing to process $'...' and $"..." only when they
appear in the WORD portion of ${PARAM OP WORD} in the here-document body
and the body is being expanded.
g. Changed alias expansion in command substitution to be posix-conformant
(performed while initially parsing the command substitution) when in posix
mode.
h. Bash optimizes away more forks in subshells.
i. Here-document construction now performs quote removal on the here-document
delimiter only if it's marked as quoted, which prevents quote characters in
command substitutions from being removed.
j. Prompt string expansion now gives invisible characters in the expansion of
the \w, \W, and \s escape sequences a visible representation to avoid
problems with redisplay.
k. Fixed a problem with SIGINT during the execution of a command bound with
`bind -x' affecting the saved terminal settings.
l. Fixed an inconsistency with how $@ expands in a construct like ${@:+set}
or ${array[@]:+set} in the presence of null positional parameters or
array elements.
2. Changes to Readline
a. Prevent some display problems when running a command as the result of a
trap or one bound using `bind -x' and the command generates output.
b. Fixed an issue with multi-line prompt strings that have one or more
invisible characters at the end of a physical line.
c. Fixed an issue that caused a history line's undo list to be cleared when
it should not have been.
3. New Features in Bash
a. There is a new bindable readline command name: `vi-edit-and-execute-command'.
4. New Features in Readline
a. Two new bindable string variables: active-region-start-color and
active-region-end-color. The first sets the color used to display the
active region; the second turns it off. If set, these are used in place
of terminal standout mode.
b. New readline state (RL_STATE_EOF) and application-visible variable
(rl_eof_found) to allow applications to detect when readline reads EOF
before calling the deprep-terminal hook.
c. There is a new configuration option: --with-shared-termcap-library, which
forces linking the shared readline library with the shared termcap (or
curses/ncurses/termlib) library so applications don't have to do it.
------------------------------------------------------------------------------
This document details the changes between this version, bash-5.2-alpha, and
the previous version, bash-5.1-release.
1. Changes to Bash
a. Fixed a bug that assigned a value to the variable name supplied as an
argument to `wait -p' when there were no jobs.
b. Fixed a bug that resulted in performing incorrect word expansion on the
key/value pairs in a compound array assignment.
c. Fixed a bug that could put the child forked to run a command substitution
into the wrong process group.
d. Fixed a problem that could cause the lastpipe option to work incorrectly if
file descriptor 0 was closed.
e. Bash tries to suppress traps if a forked child receives a trapped signal
before it has a chance to reset its signal handlers.
f. Fixed several memory leaks in compound array assignments.
g. Fixed a problem with performing an assignment with `+=' to an array element
that was the value of a nameref.
h. Fixed a bug that could cause a nameref containing an array reference using
`@' or `*' not to expand to multiple words.
i. Fixed a bug where extended glob functions could match `.' or `..' when it
wasn't explicitly specified, even if dotglob was set.
j. Fixed a bug that caused non-interactive posix-mode shells not to exit on a
variable assignment error while assigning into the temporary environment.
k. Fixed a bug that caused parsing errors if an alias contained a compound
array assignment.
l. Fixed a couple of instances where bash checked syntax too aggressively when
trying to determine how to add a partial command to command-oriented
history.
m. Fixed a parser problem that caused it not to allow reserved words to follow
the `((' and `[[' commands.
n. Fixed a bad offset calculation when using negative offsets to `history -d'.
o. Fixed an off-by-one error that caused a read past the end of a buffer when
reading a multibyte character from the output of a command substitution.
p. Fixed a problem with a failed `exec' command not setting $? to the right
value for an exit trap.
q. Fixed a problem that caused bash not to unlink FIFOs created as part of
expanding redirections for an external command.
r. Fixed a bug that could cause aliases not to be expanded in case statements.
s. Fixed a bug that could cause word completion to attempt programmable
completion for the target of a redirection, instead of filename completion.
t. Fixed a bug that could result in errors after rebinding a key sequence with
`bind -x' multiple times.
u. Fixed a problem that could result in not quoting the result when performing
command name completion with a glob pattern in the command name.
v. `mapfile' now uses fully-buffered reads in more cases, which should improve
bulk read performance.
w. Fixed a bug that caused `wait -n' to not reset its internal state when
interrupted by a signal, resulting in subsequent calls failing.
x. Fixed a bug with parsing numeric arguments to readline key sequences
installed with `bind -x'.
y. Bash suppresses forking in several additional cases, including most uses
of $(<file).
z. If there are multiple `!' tokens in a [[ command, toggle the invert state
instead of setting it unconditionally.
aa. Fixed a bug where running `fc' on an empty history list would cause the
shell to crash.
bb. Word completion now checks whether or not a quote character closes a
quoted string begun on a previous line, so readline doesn't interpret the
quote as starting a new quoted string.
cc. Fixed a typo that translated \UNNNNNNNN characters that were not valid in
the current locale encoding as \uNNNNNNNN.
dd. Fixed an issue that could cause bash to print timing statistics for the
wrong command when `set -e' causes a command to fail.
ee. Bash now runs the exit trap in function context if a failed command in
the function causes the shell to exit.
ff. Some fixes to how subshells modify $SHLVL.
gg. Fixed a bug that caused `mapfile -t' not to remove the delimiter when the
delimiter is > 128 in the current encoding.
hh. Fixed a problem that could cause the shell to attempt to free unallocated
memory if an expansion error occurred.
ii. Fixed a bug in the bash malloc implementation of malloc_usable_size. Bash
did not use it, but it could cause problems with library functions that
did.
jj. If the `exec' builtin fails, and the shell does not exit, it restores
trapped signals to their trapped state.
kk. Fixed a bug that could cause variable assignment arguments to `declare' to
expand variables using attributes that the call to declare was turning off.
ll. Fixed a bug with LINENO and arithmetic for commands.
mm. Fixed a posix-mode bug that caused tildes not to be expanded after an
unquoted colon on the right side of an assignment statement.
nn. Fixed a problem with `caller' and line numbers when executing an ERR trap.
oo. Fixed a problem that could make the value returned by ${a:=b} not be the
final value assigned to a (e.g., if `a' has an attribute that modifies
the value on assignment).
pp. Fixed a problem with saving multi-line here-documents to the history list
where the here-document delimiter does not appear on the first line.
qq. Fixed a bug with using += to assign to dynamic variables like RANDOM.
rr. Fixed a bug that caused `set -n' to modify $? if set after execution had
started.
ss. Builtins like printf/read/wait now behave more consistently when assigning
arbitrary keys to associative arrays (like `]'. when appropriately quoted).
tt. Fixed a problem with here-document collection printing the wrong prompt
when parsing a compound list in an interactive shell.
uu. Fixed a problem with quoting shell expansion characters (like `$') when
they appear in a tab-completed word along with characters that do need
quoting (e.g.. $HOME/VirtualBox VMs).
2. Changes to Readline
a. Fixed a problem with cleaning up active marks when using callback mode.
b. Fixed a problem with arithmetic comparison operators checking the version.
c. Fixed a problem that could cause readline not to build on systems without
POSIX signal functions.
d. Fixed a bug that could cause readline to crash if the application removed
the callback line handler before readline read all typeahead.
e. Added additional checks for read errors in the middle of readline commands.
f. Fixed a redisplay problem that occurred when switching from the digit-
argument prompt `(arg: N)' back to the regular prompt and the regular
prompt contained invisible characters.
g. Fixed a problem with restoring the prompt when aborting an incremental
search.
h. Fix a problem with characters > 128 not being displayed correctly in certain
single-byte encodings.
i. Fixed a problem with unix-filename-rubout that caused it to delete too much
when applied to a pathname consisting only of one or more slashes.
j. Fixed a display problem that caused the prompt to be wrapped incorrectly if
the screen changed dimensions during a call to readline() and the prompt
became longer than the screen width.
k. Fixed a problem that caused the \r output by turning off bracketed paste
to overwrite the line if terminal echo was disabled.
l. Fixed a bug that could cause colored-completion-prefix to not display if
completion-prefix-display-length was set.
m. Fixed a problem with line wrapping prompts when a group of invisible
characters runs to the right edge of the screen and the prompt extends
longer then the screen width.
n. Fixed a couple problems that could cause rl_end to be set incorrectly by
transpose-words.
3. New Features in Bash
a. The bash malloc returns memory that is aligned on 16-byte boundaries.
b. There is a new internal timer framework used for read builtin timeouts.
c. Rewrote the command substitution parsing code to call the parser recursively
and rebuild the command string from the parsed command. This allows better
syntax checking and catches errors much earlier. Along with this, if
command substitution parsing completes with here-documents remaining to be
read, the shell prints a warning message and reads the here-document bodies
from the current input stream.
d. The `ulimit' builtin now treats an operand remaining after all of the options
and arguments are parsed as an argument to the last command specified by
an option. This is for POSIX compatibility.
e. Here-document parsing now handles $'...' and $"..." quoting when reading the
here-document body.
f. The `shell-expand-line' and `history-and-alias-expand-line' bindable readline
commands now understand $'...' and $"..." quoting.
g. There is a new `spell-correct-word' bindable readline command to perform
spelling correction on the current word.
h. The `unset' builtin now attempts to treat arguments as array subscripts
without parsing or expanding the subscript, even when `assoc_expand_once'
is not set.
i. There is a default value for $BASH_LOADABLES_PATH in config-top.h.
j. Associative array assignment and certain instances of referencing (e.g.,
`test -v') now allow `@' and `*' to be used as keys.
k. Bash attempts to expand indexed and associative array subscripts only
once when executing shell constructs and word expansions.
l. The `unset' builtin allows a subscript of `@' or `*' to unset a key with
that value for associative arrays instead of unsetting the entire array
(which you can still do with `unset arrayname'). For indexed arrays, it
removes all elements of the array without unsetting it (like `A=()').
m. Additional builtins (printf/test/read/wait) do a better job of not
parsing array subscripts if array_expand_once is set.
n. New READLINE_ARGUMENT variable set to numeric argument for readline commands
defined using `bind -x'.
o. The new `varredir_close' shell option causes bash to automatically close
file descriptors opened with {var}<fn and other styles of varassign
redirection unless they're arguments to the `exec' builtin.
p. The `$0' special parameter is now set to the name of the script when running
any (non-interactive) startup files such as $BASH_ENV.
q. The `enable' builtin tries to load a loadable builtin using the default
search path if `enable name' (without any options) attempts to enable a
non-existent builtin.
r. The `printf' builtin has a new format specifier: %Q. This acts like %q but
applies any specified precision to the original unquoted argument, then
quotes and outputs the result.
s. The new `noexpand_translations' option controls whether or not the translated
output of $"..." is single-quoted.
t. There is a new parameter transformation operator: @k. This is like @K, but
expands the result to separate words after word splitting.
u. There is an alternate array implementation, selectable at `configure' time,
that optimizes access speed over memory use (use the new configure
--enable-alt-array-implementation option).
v. If an [N]<&WORD- or [N]>&WORD- redirection has WORD expand to the empty
string, treat the redirection as [N]<&- or [N]>&- and close file descriptor
N (default 0).
w. Invalid parameter transformation operators are now invalid word expansions,
and so cause fatal errors in non-interactive shells.
x. New shell option: patsub_replacement. When enabled, a `&' in the replacement
string of the pattern substitution expansion is replaced by the portion of
the string that matched the pattern. Backslash will escape the `&' and
insert a literal `&'.
y. `command -p' no longer looks in the hash table for the specified command.
z. The new `--enable-translatable-strings' option to `configure' allows $"..."
support to be compiled in or out.
aa. The new `globskipdots' shell option forces pathname expansion never to
return `.' or `..' unless explicitly matched. It is enabled by default.
bb. Array references using `@' and `*' that are the value of nameref variables
(declare -n ref='v[@]' ; echo $ref) no longer cause the shell to exit if
set -u is enabled and the array (v) is unset.
4. New Features in Readline
a. There is now an HS_HISTORY_VERSION containing the version number of the
history library for applications to use.
b. History expansion better understands multiple history expansions that may
contain strings that would ordinarily inhibit history expansion (e.g.,
`abc!$!$').
c. There is a new framework for readline timeouts, including new public
functions to set timeouts and query how much time is remaining before a
timeout hits, and a hook function that can trigger when readline times
out. There is a new state value to indicate a timeout.
d. Automatically bind termcap key sequences for page-up and page-down to
history-search-backward and history-search-forward, respectively.
e. There is a new `fetch-history' bindable command that retrieves the history
entry corresponding to its numeric argument. Negative arguments count back
from the end of the history.
f. `vi-undo' is now a bindable command.
g. There is a new option: `enable-active-region'. This separates control of
the active region and bracketed-paste. It has the same default value as
bracketed-paste, and enabling bracketed paste enables the active region.
Users can now turn off the active region while leaving bracketed paste
enabled.
h. rl_completer_word_break_characters is now `const char *' like
rl_basic_word_break_characters.
i. Readline looks in $LS_COLORS for a custom filename extension
(*.readline-colored-completion-prefix) and uses that as the default color
for the common prefix displayed when `colored-completion-prefix' is set.
------------------------------------------------------------------------------
This document details the changes between this version, bash-5.1-rc3, and
the previous version, bash-5.1-rc2.
1. Changes to Bash
a. The `assoc_expand_once' option now affects the evaluation of the -v primary
to test and the [[ compound command.
2. Changes to Readline
a. Fixed a bug that could cause point to be set beyond the end of the line
buffer when aborting an incremental search.
3. New Features in Bash
4. New Features in Readline
------------------------------------------------------------------------------
This document details the changes between this version, bash-5.1-rc2, and
the previous version, bash-5.1-rc1.
1. Changes to Bash
a. Process substitutions started from an interactive shell no longer have their
standard input implicitly redirected from /dev/null.
b. Fixed an issue with setting the SIGINT trap handler in an interactive shell
when temporarily running $PROMPT_COMMAND non-interactively.
2. Changes to Readline
a. Terminals that are named "dumb" or unknown do not enable bracketed paste
by default.
b. Ensure that disabling bracketed paste turns off highlighting the incremental
search string when the search is successful.
3. New Features in Bash
4. New Features in Readline
------------------------------------------------------------------------------
This document details the changes between this version, bash-5.1-rc1, and
the previous version, bash-5.1-beta.
1. Changes to Bash
a. Fixed an inconsistency in the way HISTCMD is calculated when it's expanded
during a multi-line command.
b. Modified the change to here-document expansion containing backslash-quoted
double quotes.
c. Fixed a case where the shells's exit status could be greater than 255.
d. Modified changed to process substitution so the executed command has its
stdin redirected from /dev/null if it was previously interactive and
reading commands from the terminal.
2. New Features in Bash
a. There is a new contributed loadable builtin: asort.
3. Changes to Readline
a. Fixed a bug that could cause an application with an application-specific
redisplay function to crash if the line data structures had not been
initialized.
4. New Features in Readline
------------------------------------------------------------------------------
This document details the changes between this version, bash-5.1-beta, and
the previous version, bash-5.1-alpha.
1. Changes to Bash
a. Fixed a bug that caused name references to variables to not update the
referenced variable's assignment side effects.
b. Tightened up the parameter transformation error checking for invalid
transformation operators.
c. System-specific changes for: FreeBSD
d. A few minor changes to move potential uses of stdio functions out of signal
handling paths.
e. Make sure SIGCHLD is blocked in all cases where waitchld() is not called
from a signal handler.
f. Changed `command' builtin processing so it no longer starts an extra process
when run asynchronously (command x &).
g. Avoid performing tilde expansion after `:' in words that look like assignment
statements when in posix mode.
h. Slight changes to how the `complete' builtin prints out options and actions
for completion specifications.
i. Several changes to how `local -' restores the values of options and
$SHELLOPTS.
j. Don't treat a word in a compound assignment as an assignment statement
unless it has a valid subscript before the `='.
k. Fixed a bug with the DEBUG trap and process substitution that caused the
terminal's process group to be set incorrectly.
l. Fixed a bug that left readline's signal handlers installed while running a
shell command from a bindable readline command.
m. Fixed the `fc' builtin to clamp out of range history specifications at the
boundaries of the history list for POSIX conformance.
n. Fixed a bug that caused ${foo@a} to treat foo as an unset variable if it
was an array without a value for subscript 0/"0" but had other set
elements.
o. Fixed a bug that caused the history code to attempt to parse command
substitutions looking for shell comments before adding them to the history,
even while parsing here-documents.
p. Fixed a bug that could cause a syntax error in a command read by `eval' to
exit an interactive shell.
2. New Features in Bash
a. If the hash builtin is listing hashed filenames portably, don't print
anything if the table is empty.
b. GLOBIGNORE now ignores `.' and `..' as a terminal pathname component.
c. Bash attempts to optimize away forks in the last command in a function body
under appropriate circumstances.
d. The globbing code now uses fnmatch(3) to check collation elements (if
available) even in cases without multibyte characters.
e. The `fg' and `bg' builtins now return an error in a command substitution
when asked to restart a job inherited from the parent shell.
f. The shell now attempts to unlink all FIFOs on exit, whether a consuming
process has finished with them or not.
3. Changes to Readline
a. Make sure that all undo groups are closed when leaving vi insertion mode.
b. Make sure that the vi-mode `C' and `c' commands enter insert mode even if
the motion command doesn't have any effect.
c. Fixed several potential memory leaks in the callback mode context handling.
d. If readline is handling a SIGTTOU, make sure SIGTTOU is blocked while
executing the terminal cleanup code, since it's no longer run in a signal
handling context.
4. New Features in Readline
a. The signal cleanup code now blocks SIGINT while processing after a SIGINT.
------------------------------------------------------------------------------
This document details the changes between this version, bash-5.1-alpha, and
the previous version, bash-5.0-release.
1. Changes to Bash
a. Fixed a bug that caused a posix-mode shell to not exit if the return builtin
was executed outside a function or dot script.
b. Fixed a bug where `declare +f' could potentially turn off the function
attribute.
c. Restored bash-4.4 pathname expansion behavior when a word to be expanded had
only backslashes, not any of the other globbing characters. This came after
an extensive POSIX group discussion (interp #1234).
d. There are more changes to avoid performing word expansions multiple times on
arithmetic expressions.
e. Fixed a bug with alias expansion when the alias ends with a TAB.
f. Fixed a bug that caused programmable completion to return an error if the
shell function name supplied as an argument to `complete -F' was invalid.
g. There are several fixes to buffer overflows found as the result of fuzzing
with random input.
h. Fixed a bug that caused the edit-and-execute-command editing command to
start with the previous history line if invoked on an empty line.
i. Fixed a bug that potentially caused `bind --help' to change readline's
output stream.
j. Turning off posix mode now restores the vi-insertion mode binding for TAB
that was in effect when posix mode was enabled.
k. Restore the previous state of job control being enabled if `exec' fails in
an interactive shell.
l. Fixed a bug that caused the terminal's process group to be set incorrectly
if job control was turned off before starting an interactive shell.
m. Fixed a bug that caused a crash when HISTSIZE=0.
n. Fixed a word expansion bug that caused null strings on the rhs of expansions
to be discarded incorrectly.
o. History list management does a better job of handling the situation where
the number of history entries from the current shell session is greater than
the number of entries in the history list.
p. Fixed a bug that caused the `fc' builtin to attempt to dereference a newly-
freed history entry.
q. Fixed a bug that made the `Q' variable transformation not work well with
`set -u'.
r. There are several word expansion fixes for expanding $* and $@ in contexts
where word splitting is not going to be performed, since each positional
parameter must expand to a separate word.
s. Fixed a bug that could cause ^D to exit bash immediately even if there were
stopped jobs.
t. Fixed a bug with double-quoting and backslash-quoting strings containing
multibyte characters for reuse.
u. Fixed a bug that caused the line number to be reported incorrectly if the
shell executed a (command) subshell.
v. Fixed a bug that caused the shell to fail to reap process substitutions
when they went out of scope, which had unpredictable results.
w. Fixed a bug that caused null strings in arguments to [[ conditional command
operators to compare incorrectly.
x. Changed the behavior of `wait' without arguments to only wait for background
processes the current shell instance started, not background children it may
have inherited.
y. Fixed a bug that could cause command substitution to leave file descriptors
open if the shell received many SIGINTs.
z. Bash now behaves better if the `**' filename expansion operator encounters a
symbolic link to a directory, avoiding more cases where it might return
duplicate pathnames.
aa. Programmable completion now canonicalizes directory names in the same way
as bash word completion, so `..' is handled consistently.
bb. Fixed a bug when using RETURN as the delimiter to the read builtin; it
caused readline to set the binding for RETURN incorrectly.
cc. Fixed a bug that caused `history -d' to delay printing an out-of-range
error message.
dd. Fixed a bug with `bash -c command' where `command' ends with an expanded
alias.
ee. Fixed a bug that could result in `history -n' adding spurious line feeds to
commands in the history list.
ff. The $RANDOM random number generator now XORs the top and bottom halves of
the internal 32-bit value to introduce more randomness. Setting the shell
compatibility level to 50 or lower undoes this.
gg. Fixed several problems caused by running the DEBUG trap on simple commands
executed as part of a pipeline.
ii. Fixed a bug that didn't allow `bind -r' to remove the binding for \C-@.
jj. Several fixes to the bash-backward-shellword bindable readline command to
behave better when at the last character on the line.
kk. If `set -x' is enabled, bash doesn't print a command twice if it's run by
the `command' builtin.
ll. Fixed a bug with printing function definitions containing here documents.
mm. Fixed a bug that could cause the `bind' builtin to set $? to -1.
nn. Fixed a bug that didn't reset the timezone information correctly when the
TZ variable was unset.
oo. Fixed several issues with assigning an associative array variable using a
compound assignment that expands the value of the same variable.
pp. Fixed several places where the shell set $? without setting PIPESTATUS.
qq. Fixed a problem with glob bracket expressions containing invalid character
classes, collating symbols, or equivalence classes -- they should not
require a closing right bracket.
rr. Fixed a bug where running a builtin in a subshell did not run the EXIT trap.
ss. Fixed several problems with posix-mode variable assignments preceding
shell function calls and posix special builtins, so that they create and
modify variables at the current scope.
tt. Fix history initialization so `bash +o history' works as expected.
uu. Fixed a bug in the bindable edit-and-execute-command command that could
interfere with the shell's parsing state.
vv. Fixed an issue with nested traps running command substitutions in command
lines with command substitutions.
ww. Fixed a bug with globbing pathnames that contain invalid multibyte
characters (sequences that don't correspond to a character in the current
locale).
xx. Fixed a bug that caused the shell not to exit if a function definition
failed while errexit was enabled.
yy. Process substitution processes now get their input from /dev/null, since
they are asynchronous, not interactive, and not jobs.
zz. Setting nocaseglob no longer turns on case-insensitive regexp matching.
aaa. Fixed a bug that resulted in extra blank lines being added to some history
entries containing here-documents.
bbb. Fixed a bug that resulted in incorrect matching of some patterns in word
expansion if they expanded to the empty string.
ccc. Fixed here-string expansion so it behaves the same as expansion of the
rhs of an assignment statement.
ddd. Changed here-document parsing to no longer allow the end of the here
document to delimit a command substitution.
eee. Several fixes to history expansion: multiple :p modifiers work, a ^ word
designator works as part of a range, and a `-' is treated as part of a
search string if it immediately follows a `!'.
fff. Fixed a bug in pattern substitution with null matches in a string
containing multibyte characters.
ggg. Unbinding a key sequence bound with `bind -x' now removes the key sequence
from the additional keymap `bind -x' uses.
hhh. Fixed a bug with command start detection for completion so that it doesn't
mistake brace expansion for the start of a command.
iii. Fixed a bug that caused local variables with the same name as variables
appearing in a function's temporary environment to not be marked as local.
jjj. Fixed a bug that could cause SIGCHLD to be blocked when executing return
or exec in the rightmost pipeline element with lastpipe enabled.
kkk. Fixed a bug that could result in commands without the execute bit set
being added to the command hash table.
lll. Fixed a bug that allowed non-digits to follow the `#' in a `base#number'
integer constant.
mmm. Fixed a bug that made `time -- command' attempt to execute `--'.
nnn. Fixed a couple of bugs with variable transformation using arrays
subscripted with `*' or `@'.
ooo. A failure to create a variable using `declare' in a function no longer
causes the function to return immediately.
ppp. Fixed a bug that could cause the := word expansion to add a non-null
value if attempting to assign a null string when double-quoted.
qqq. Fixed a bug that could cause backslashes quoting double quotes in here
document bodies to not be removed when expanding the body.
rrr. Fixed a bug that caused commands following a subshell while the shell is
reading input from stdin but not interactive, while job control is
enabled, to be executed twice.
sss. Fixed a bug where receiving SIGTERM from a different process while
readline was active could cause the shell to terminate.
ttt. In posix mode, running a trap after the read builtin now sees the exit
status of the read builtin (e.g., 130 after a SIGINT) in $?.
uuu. Fixed a bug with nameref variables referencing array subscripts used in
arithmetic expressions.
vvv. Fixed a bug that caused the pipeline process group id to be reset in the
middle of a command list run by a shell started to run a command
substitution.
www. Restricted shells can no longer read and write history files with pathnames
containing slashes.
xxx. Fixed a couple of problems with 0 and -0 used as arguments to `fc' when
not listing commands from the history.
yyy. When `test' is supplied four or more arguments, treat an argument that
looks like an operator (e.g., -e), but is in a place where only a string
is valid, as a string, as it would be when using the POSIX rules, instead
of an operator with a missing argument.
zzz. There is no `compat50' shopt option. Changes to the shell compatibility
level should use the BASH_COMPAT variable.
aaaa. Redirection failures with compound commands are now treated as errors
that cause the shell to exit if `errexit' is enabled.
bbbb. Redirection failure error messages no longer expand the word in the
redirection again.
cccc. History expansion is no longer performed while parsing a here-document
inside a command substitution.
2. Changes to Readline
a. There are a number of fixes that were found as the result of fuzzing with
random input.
b. Changed the revert-all-at-newline behavior to make sure to start at the end
of the history list when doing it, instead of the line where the user hit
return.
c. When parsing `set' commands from the inputrc file or an application, readline
now allows trailing whitespace.
d. Fixed a bug that left a file descriptor open to the history file if the
file size was 0.
e. Fixed a problem with binding key sequences containing meta characters.
f. Fixed a bug that caused the wrong line to be displayed if the user tried to
move back beyond the beginning of the history list, or forward past the end
of the history list.
g. If readline catches SIGTSTP, it now sets a hook that allows the calling
application to handle it if it desires.
h. Fixed a redisplay problem with a prompt string containing embedded newlines.
i. Fixed a problem with completing filenames containing invalid multibyte
sequences when case-insensitive comparisons are enabled.
j. Fixed a redisplay problem with prompt strings containing invisible multibyte
characters.
k. Fixed a problem with multibyte characters mapped to editing commands that
modify the search string in incremental search.
l. Fixed a bug with maintaining the key sequence while resolving a bound
command in the presence of ambiguous sequences (sequences with a common
prefix), in most cases while attempting to unbind it.
m. Fixed several buffer overflows found as the result of fuzzing.
n. Reworked backslash handling when translating key sequences for key binding