-
Notifications
You must be signed in to change notification settings - Fork 0
/
NEWS
3022 lines (2115 loc) · 121 KB
/
NEWS
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 documents significant changes in the dev branch of ksh 93u+m.
For full details, see the git log at: https://github.com/ksh93/ksh
Uppercase BUG_* IDs are shell bug IDs as used by the Modernish shell library.
2024-07-21:
- Fixed a long-standing parsing bug: a '((' that was unmatched by
corresponding closing parentheses and enclosed within a compound command
failed to throw a syntax error and could cause the shell to crash.
- [v1.1] In emacs mode, pressing ^U (kill) twice no longer causes further
^U presses to start a new line (this was a feature for paper terminals).
2024-07-20:
- Fixed a regression where a broken pipe signal (SIGPIPE), when occurring in
a pipe construct within a subshell, caused incorrect signal handling in the
parent/main shell, in some cases causing a script to abort. Bug introduced
on 2022-07-02.
2024-07-18:
- Fixed a regression where 'read' cannot create a previously nonexistent
variable when used within a namespace block. Bug introduced on 2023-06-02.
2024-07-17:
- Fixed: if the --posix or --letoctal option was turned on, octal numbers
designated by the leading-zero octal prefix enabled by these options but
containing the invalid digits 8 or 9 (e.g., $((09)) or let "09") failed
to throw an error and were instead incorrectly reinterpreted as decimal.
- Fixed: invalid leading zeros in the '0x' hexadecimal prefix or in ksh
arithmetic base specifiers, e.g., 00x2F or 016#2F (instead of 0x2F or 16#2F),
failed to throw an arithmetic syntax error.
2024-07-16:
- The history expansion character ('!' by default) is now not processed when
immediately following '${'. This makes it psosible to use expansion syntax
like ${!varname} and ${!prefix@} on the interactive command line with the
histexpand option on; these no longer trigger an "event not found" error.
2024-07-13:
- The shell is now capable of handling more than 32767 simultaneous
background jobs, subject to system limitations.
2024-07-02:
- Support for UNC paths (//server/dir) is now enabled by default on Cygwin.
2024-06-30:
- Fixed: the 'hash' and 'alias -t' commands no longer autoload functions
from executable files on FPATH as an unintended side effect.
- [v1.1] The 'hash' and 'alias -t' commands now issue an error message for
each command given that was not found on PATH, and return a non-zero exit
status if any of the commands given were not found.
2024-06-27:
- Fixed: a builtin activated with the 'builtin' command was not found if
invoked within a namespace block on the same line as the 'builtin' command.
2024-06-26:
- Fixed: when the --showme option was used with a command containing multiple
redirections, only the first redirection was shown, without a newline. This
bug was introduced along with --showme in ksh 93s- 2006-09-12.
2024-03-05:
- Fixed a corner case bug causing incorrect field splitting behaviour of a
repeated whitespace character in the IFS variable. The behaviour was
incorrect when the posix option was changed while xtrace was on, or when a
shell discipline function was defined for IFS. Bug introduced on 2022-03-05.
2024-03-03:
- Fixed incorrect behaviour of {n1..n2..incr} range brace expansions, which
sometimes occurred if the value of n1 multiplied by incr falls outside of
the INT_MIN..INT_MAX range. For instance, {1696512000..1696512000..300}
now correctly outputs only 1696512000.
2024-03-30:
- A regression was fixed in ordinal specifiers in 'printf %T' date
specifications. For example,
printf '%(%F)T\n' '4th tuesday in march 2016'
wrongly printed '2016-04-09' and now again correctly prints '2016-03-22'.
This regression was introduded with the printf fixes on 2023-05-18.
2024-03-24:
- We now support building a dynamically linked ksh 93u+m with libast,
libdll, libcmd, and libshell available as dynamic libraries for other
applications to use. The dynamically linked version is built in a 'dyn'
subdirectory; there are no changes to the statically linked version. See
README.md for more information. Dynamic linking is tested and supported
on Linux, Android, macOS, FreeBSD, NetBSD, OpenBSD, illumos and Solaris.
Please test this on other platforms and send us your reports and patches.
2024-03-22:
- Fixed a crash in the getconf built-in that could occur after the 'builtin'
command was used to bind it to the same path as the external getconf command.
2024-03-20:
- Android with Termux is now a supported environment for ksh 93u+m. Testing
was done on Android 14.0 with Termux 0.118.0. Please report any breakage.
Build dependencies (Termux packages): clang, binutils, getconf. Runtime
depenencies: ncurses-utils (for --multiline), getconf (fallback for the
/opt/ast/bin/getconf builtin).
2024-03-12:
- Fixed a regression in the 'printf' built-in, introduced on 2023-05-17,
where each instance of '\0' or '%Z' in the format operand caused a string
argument to be incorrectly skipped.
2024-03-10:
- Fixed a longstanding bug where the default terminal width for typeset -L, -R,
or -Z, if not given, was miscalculated for multibyte or control characters.
- Fixed a crash on redefining an array inherited from the parent environment
in a subshell.
- Fixed corner case breakage of universe handling in the 'echo' command: it
broke when used in a namespace block before being used anywhere else, and
only if _AST_FEATURES was not exported first. The bug caused _AST_FEATURES to
be incorrectly placed in that namespace. Bug introduced on 2023-06-02.
2024-03-07:
- Fixed a bug that caused some systems to corrupt the display of multibyte
characters in the command prompt.
2024-03-05:
- Fixed a regression, introduced on 2021-02-07, that made the common AST
options '--???ESC' and '--???noESC' ineffective for enabling/disabling
ANSI escape codes for emphasis in the output of --man or --help.
(Type, e.g., print '--???' for more information about common options.)
- Fixed a rare crash in the 'print' built-in due to the use of uninitialised
memory while parsing options. Bug introduced in ksh 93u+ 2012-05-31.
- Fixed a 2021-04-14 regression: the 'exec' command (which runs a command
that replaces the shell process and therefore should only run external
commands) would run a path-bound built-in if /opt/ast/bin is in PATH.
- Fixed a corner case bug: a ${ shared-state command substitution;} failed to
capture the standard output of a command that replces the shell via 'exec'.
2024-02-29:
- Improved the robustness of the routines handling the execution by ksh of a
script without an initial #! path. More memory is freed up after ksh forks.
- Fixed a crash that could occur after 'typeset +x var' when var was imported
from the environment and then a discipline function was set for it.
2024-02-23:
- [v1.1] The commands ':', 'true', 'false', 'break' and 'continue' have been
optimised to run faster in loops in certain common cases. For example, the
'true' in 'while true; do some_stuff || break; done' now runs faster.
2024-02-22:
- Fixed a crash that occurred when starting ksh with no TERM variable in the
environment (e.g., in single user mode on NetBSD and DragonFlyBSD).
- Fixed a regression of 'return' within traps, reintroduced on 2023-12-25
after being fixed on 2020-09-09. The regression caused a 'return' or
'exit' with no arguments to assume the before-trap exit status instead of
that of the last-run command. This broke the shipped 'autocd' function.
- Fixed some integer overflows that could occur when using TMOUT.
- Fixed a crash on Solaris and illumos when cancelling a here-document
with ^C or ^D in an interactive shell.
2024-02-17:
- Fixed a crash that could occur when using 'typeset -T' typed variables
in a virtual subshell.
2024-02-11:
- Added SHOPT_PRINTF_LEGACY compile-time option for compatibility with
POSIX-ignorant external printf(1) commands that process a format operand
starting with '-' without the standard preceding '--' options terminator.
This is for backward compatibility with local system scripts. The
behaviour of the system's external printf(1) determines whether this is
compiled in or out by default. Normal ksh printf options keep working.
- Fixed a bug, introduced on 2023-06-02, that made it impossible within a
namespace to unset a function defined outside the namespace.
- Fixed: ksh didn't pass the exit status of the last command it executed to
the parent process on entering EOF (Ctrl+D) on a terminal.
2024-02-09:
- Fixed multiple inaccurate or missing values in the /opt/ast/bin/getconf
path-bound built-in command.
2024-02-08:
- Fixed an init-time crash that may occur if standard error is on a terminal,
but the path to its tty device can't be found (e.g., in a chroot situation).
- Fixed corrupted output of the 'time' keyword as formatted via TIMEFORMAT on
systems where sizeof(time_t) != sizeof(int). Bug introduced on 2020-07-13.
2024-02-06:
- Fixed a regression introduced on 2023-03-04 that caused ksh to lock up
after using the Arch Linux arch-chroot script.
2024-02-03:
- Fixed: the arithmetic representation of negative integers with a base other
than 10 is no longer incorrectly treated as unsigned long. For example,
typeset -i16 n=-12; echo $n
now correctly outputs '-16#c' and no longer ouputs '16#fffffffffffffff4'.
2024-01-27:
- Fixed: tilde expansion discipline functions (see 2021-03-16) were not
reinitialised when executing a ksh script without a #! path line.
2024-01-23:
- Fixed a rare crash or rare incorrect behaviour in .sh.tilde.{get,set}
discipline functions for ~ expansion (see 2021-03-16 below).
- Fixed a bug that caused listing the .sh.match variable with ${!.sh.match} to
show spurious elements.
2024-01-22:
- Fixed a bug in the loop invariants optimizer (SHOPT_OPTIMIZE) that caused
expansions of name references to be incorrectly treated as invariant so they
yielded the wrong values. Fix backported from from ksh 93v- 2013-02-13.
- Fixed a buffer overflow that could occur when using tab completion
with multibyte filenames.
2024-01-21:
- [v1.1] New feature added: SRANDOM is a secure random number generator.
It uses the native OS implementation of arc4random(3) or, absent that, an
integrated OpenBSD-based version that uses the ChaCha20 cipher. An upper
bound can be set by assigning its value to SRANDOM; subsequent numbers will
be uniformly distributed between 0 and the value of the upper bound minus
one, in a way that avoids "modulo bias". Assigning 0 restores default mode.
- A bug was fixed that caused both the 'set' and 'get'/'getn' discipline
functions of a variable to be triggered when performing an assignment in
an arithmetic expression; only the 'set' discipline is now triggered when
assigning (as was always the documented behaviour). This applies to the
shell's internal disciplines as well. For example, $RANDOM is no longer
spuriously read from while seeding it via an arithmetic expression.
- Fixed: assigning to LINENO, RANDOM, or _ via an arithmetic expression gave
undefined results on systems where sizeof(long double)!=sizeof(double).
2024-01-16:
- Fixed a parsing bug in array subscripts containing '=' in combination with
a declaration command (such as 'typeset' or 'export'). For instance,
'typeset -A arr; typeset -i arr[foo=bar]=123' now works correctly.
2024-01-15:
- Fixed a bug, introduced in ksh93q+ 2005-05-22, that stopped an append
assignment from working together with a declaration command. For example,
'typeset var+=value' or 'export var+=value' now again work as expected.
2024-01-14:
- Fixed a regression introduced on 2022-11-01 that caused ksh to enter
an infinite loop after using the up arrow in emacs mode with an empty
history file.
- Fixed a bug in 'read -s': in a script, the first invocation of that
command, with the emacs or vi shell option on, did not allow the user to
navigate through the shell history file.
2024-01-11:
- Fixed ancient incorrect behaviour in the 'kill' built-in: it sent SIGCONT
to the given process along with every other non-SIGCONT signal issued,
causing a stopped process to be incorrectly resumed upon sending it any
signal and causing any SIGCONT trap handler to be incorrectly triggered.
- Fixed: the 'kill' built-in was not able to terminate an interactive shell
by sending a signal such as SIGHUP to its own shell (e.g. kill -s HUP $$).
2024-01-05:
- Fixed a potential crash on pressing Ctrl+C on the command line while
history expansion (the -H or histexpand option) is active.
2023-12-28:
- Fixed intermittent incorrect behaviour (a race condition), introduced on
2023-09-15, that occurred on some systems when running an external command
with a redirection from a command substitution.
- Fixed an init-time crash on failure to trim the shell command history file
due to a non-writable parent directory; ksh now prints a warning instead.
2023-12-25:
- Fixed a regression in the behavior of 'exit' in a trap action, introduced
on 2020-09-09. The default exit status, used when no argument is given to
'exit', is now once again the exit status of the last command executed
*before* the trap action, as expected.
2023-09-16:
- The 'kill' built-in command was meant to refuse to issue SIGSTOP to the
shell's process if the shell is a login shell (because this normally
causes an unrecoverable freeze of the terminal session). The code
prohibiting this did not work on modern systems and is now fixed.
2023-09-15:
- Fixed a hang in command substitutions (introduced in 93u+m/1.0.0) that was
triggered when redirecting standard output within a command substitution,
in combination with other factors. E.g., the following no longer hangs:
{ v=$(redirect 2>&1 1>&9); } 9>&1
2023-09-13:
- Fixed a crash on trying to append an indexed array value to an unset name
reference, e.g.: nameref unsetref; unsetref+=(foo bar). This now produces
a "removing nameref attribute" warning before performing the assignment.
- Fixed: assignments like name=(...) to arrays did not preserve the array and
variable types. Fix backported from ksh 93v- beta (2013-07-19, 2013-07-27).
- Fixed: assigning an empty set () to a compound indexed array caused the -C
attribute to be lost. Fix backported from ksh 93v- beta (2013-09-13).
2023-09-09:
- Fixed incorrect rejection of the tab key while reading input using the `read`
built-in command. Bugs introduced on 2021-02-26 (emacs) and 2022-08-24 (vi).
- Fixed a minor bug that could cause '/opt/ast/bin/getconf PID_MAX' to
return the wrong value when ksh is built with strict C99.
- Fixed a bug in printf %T: when using dates and times in the past, time
zones for the present were incorrectly used, ignoring historical changes.
2023-06-13:
- Fixed a serious regression in pathname expansion where quoted wildcard
characters were incorrectly expanded if a pattern contains both a brace
expansion and a variable expansion.
2023-06-12:
- Fixed a bug where ^X^E in emacs or 'v' in vi, which invoke a full-screen
editor to edit the command line, could cause the wrong command line to be
edited if two shell sessions share a .sh_history file.
- In the emacs line editor, ^X^E no longer echos the hist command it invokes.
2023-06-10:
- Ksh can now compile on most operating systems when using -std=c99 in CCFLAGS.
2023-06-09:
- Fixed a bug where the 'break' and 'continue' commands stopped working after
changing scope levels (.sh.level=n) within a loop invoked from a DEBUG trap.
2023-06-05:
- Fixed a bug in command completion: when a shell built-in or defined function
was preceded in alphabetical order by an undefined function (on FPATH or
after 'autoload'), the built-in or defined function failed to tab-complete.
2023-06-04:
- Fixed a bug in 'case', introduced in ksh 93t 2008-10-31, where extended
patterns containing a closing brace ('}') caused a spurious syntax error.
- The POSIX mode was amended to make 'test -e /dev/fd/n' (where n is a file
descriptor number) actually test for the existence of /dev/fd/n in the
file system. By default it tests if that file descriptor is open.
2023-06-02:
- Fixed a bug introduced on 2021-04-24 where unsetting a function in a
subshell hides any built-in command by the same name for the duration
of that subshell.
2023-05-30:
- Fixed a bug in the 'type -t'/'whence -t' output for an undefined function.
- The autoloadable directory stack and menu-based cd functions in the 'fun'
directory have been reorganised and fixed to play well together when that
directory is added to FPATH.
2023-05-29:
- Fixed a bug in bracket expressions in glob patterns where quoting a '!'
(e.g., to disable its negator function) caused a '\' to be wrongly matched.
For example,
case '\' in ['!'X]) echo BAD;; esac
no longer outputs BAD, and
touch '\'; ls ['!'X]
no longer incorrectly lists the file '\'.
2023-05-28:
- Fixed a bug, introduced on 2020-06-08 and exacerbated on 2022-07-02, where
the exit status of a script did not reflect the signal with the 9th bit
set if the script exited on receiving a signal and an EXIT trap was set.
2023-05-27:
- Fixed a bug in the handling of backslashes in pathname expansion patterns
resulting from field splitting. For example, the following:
$ mkdir testdir; cd testdir; touch b; p='[a\-c]'; echo $p
now correctly recognises the backslash escape and no longer outputs 'b'.
- The 2023-05-19 fix for brace expansion interfering with extended patterns has
been improved to also recognise and handle extended patterns that are parts
of larger patterns, e.g., 'ls file~(E)[[:digit:]]{3,6}\.txt$' now works.
- [v1.1] Added a new 'globex' shell option that causes extended patterns,
i.e. those with a syntax involving parentheses, to be expanded in fields
resulting from field splitting. These are normally disabled in that context
for compatibility with other shells and old ksh versions. For example,
$ var='~(E)foo'; set --globex; ls $var
will now list files with names containing 'foo'.
2023-05-19:
- Fixed a bug in the loop invariants optimizer where a variable for which
a .get or .getn discipline function is set within a loop is incorrectly
treated as invariant.
- Fixed two bugs in pathname expansion:
1. Brace expansion interfered with EREs and other extended pattern
types used with ~(...) pattern option prefixes, e.g. the {3,6} in
'ls ~(E)^file[[:digit:]]{3,6}\.txt$' was incorrectly parsed as a
brace expansion instead of an ERE bound matching 3 to 6 digits.
That command will now list any matching files such as file1234.txt.
2. With brace expansion disabled (set +B), any '{' character in a file
name pattern stopped it from being resolved unless a wildcard followed
it. Now, 'set +B; ls *{' will list files with names ending in '{'.
2023-05-18:
- Fixed multiple bugs causing incorrect output for relative date specifications
given as arguments to printf %(dateformat)T. For example, something like
printf '%(%Y-%m-%d %H:%M)T\n' 'exact 9 weeks ago'
will now produce the correct output, which is the same as GNU date:
date '+%Y-%m-%d %H:%M' '9 weeks ago'
2023-05-17:
- Fixed buggy behaviour of printf with mix and match of % and %x$.
2023-05-15:
- Fixed a crash on executing a nested compound assignment in a command
substitution.
2023-05-14:
- If history expansion is active, then command and file name completion now
quotes the history expansion characters with a backslash as needed to
avoid triggering history expansion failures if one of those characters
occurs in a command or file name.
- Fixed completion of file names starting with an escaped literal tilde.
- Undocumented and non-functional goto label functionality has been removed.
Command names can now end in ':' like on other shells, as POSIX requires.
2023-05-11:
- The ability to use multi-line editing is now detected at runtime instead of
compile time, making detection more reliable across terminals and platforms.
2023-05-01:
- Fixes for indexed arrays declared to use enum constants for subscripts:
- Syntax validation: add missing check for ] in 'typeset -a \[type] array'.
- Fixed error message when type in 'typeset -a \[type] array' is unknown.
- Fixed 'typeset -p' output of such arrays to quote the square brackets.
2023-04-09:
- Fixed command line redrawing on resizing the window with --multiline off.
- Multiline editing is now automatically disabled if and when the TERM
environment variable is unset, not exported, or set to a terminal type
that does not support the necessary operations. It is automatically
re-enabled when the TERM variable is corrected and --multiline is on.
2023-04-08:
- Fixed a termcap(5) detection bug that broke multiline editing on FreeBSD.
2023-04-05:
- Fixed a spurious syntax error in compound assignments upon encountering a
pair of repeated opening parentheses '(('. This bug behaved differently
depending on whether the compound assignment was outside or within a command
substitution of the form $(...) or ${ ...; }. Both cases are now fixed.
- Fixed a parsing bug in arithmetic functions like
function .sh.math.add x y { .sh.value=x+y; }
so that the '.sh.value=x+y' is correctly interpreted as an assignment, not
as a command name. After this, (( z = add(x,y) )) works correctly.
2023-04-03:
- Fixed multiple crashing bugs in discipline functions invoked from non-forked
subshells, including corruption of the $_ variable.
2023-04-02:
- Corrected the 2022-07-05 fix for the detection of a syntax error in
compound assignments to associative arrays.
- Fixed spurious syntax error in ${parameter:offset:length}: the arithmetic
expressions 'offset' and 'length' may now contain the operators ( ) & |.
2023-03-29:
- Fixed a bug in 'printf -v' (added on 2021-11-18) where using the %B format
specifier would overwrite any data already written to the variable.
- In the ${parameter/pattern/string} search-and-replace expansion, an
anchored empty pattern will now match the beginning or the end of the
string, so that ${parameter/#/string} will prefix the string to the
parameter value and ${parameter/%/string} will append it. Previously,
these operations were no-ops (equivalent to ${parameter}). This change
brings ksh 93u+m into line with mksh, zsh and bash.
2023-03-26:
- Fixed an intermittent crash in 'command -x' experienced on some arm/arm64
systems running Linux.
- Fixed a bug that caused 'printf "%(%Z)T\n" now' to print nonsense strings
such as 'ica' on Cygwin.
2023-03-24:
- Fixed a crash in read -d D in multibyte locales that occurred when a byte
with the 8th bit set was passed as the delimiter character D. For example,
read -d $'\200' crashed in a UTF-8 locale. (Note that multibyte delimiter
characters are not supported yet.)
2023-03-23:
- A bug has been fixed in 'printf' and 'print -f' that caused the %a, %A, %e,
%E, %f, %F, %g, and %G conversion specifiers to evaluate any unexpanded
arithmetic expression passed to them twice, causing any side effects, such
as incrementing a variable, to be incorrect. Bug introduced in 93t- (2008).
- The POSIX compatibility mode has been amended to cause 'printf' to parse only
decimal/hexadecimal/octal constants for its numerical conversion specifiers,
instead of arithmetic expressions. (POSIX mode does not change 'print -f'.)
2023-03-20:
- Fixed incorrect result of array slicing ${array[@]:offset:length} where
'length' is a nested expansion involving an array. For example,
${array[@]:0:${#array[@]}} is now correctly equivalent to ${array[@]}.
- Fixed bugs in 'command -x' and 'command -v -x' (see 2021-01-30) that caused
it to fail to disregard built-ins if /opt/ast/bin (the virtual path for
path-bound built-ins) is in $PATH.
2023-03-19:
- Fixed a crash in 'read' (as well as a spurious error in 'printf -v', added
on 2021-11-18) when using an indexed array subscript with an arithmetic
expression that yields 0 while also modifying the variable. For example,
'i=-1; read a[i+=1]' crashed. Bug introduced in ksh 93s+ 2008-01-31.
- In the 'read' built-in, a '=' in a variable name argument is now once
again an error and is no longer misparsed as an assignment, which caused
inconsistent behaviour or (in the case of 'read -C foo=bar') a crash. This
fixes a bug introduced in ksh 93u+ 2011-04-28.
2023-03-17:
- Fixed nameref self-reference loop detection; as of ksh 93u 2010-11-22, this
failed for loops of more than two refs. For example, 'nameref a=b b=c c=a'
now correctly outputs an 'invalid self reference' error message.
2023-03-16:
- Backported a fix from ksh 93v- beta for a bug in the 'for' loop optimizer
which could falsely treat 'typeset -b' variables as loop invariants.
2023-03-04:
- Fixed a bug introduced on 2022-02-08 that caused string translation using
$"..." to either crash or fail silently.
2023-03-03:
- A new SHOPT_SCRIPTONLY compile-time option was added that, if enabled,
compiles out the interactive shell, resulting in a ksh binary that can
only run scripts. See src/cmd/ksh93/README for more information.
2023-02-23:
- Fixed a crash or corrupted output that occurred on some systems if the vi
'.' repeater command was used immediately after starting ksh in vi mode.
- In vi mode, when navigating back in the command history and then editing a
line from the history, the U command now correctly undoes the latest edit
to the history line instead of jumping back to the current command line.
2023-02-22:
- ksh now throws a panic and exits if a read error (such as an I/O error)
occurs while trying to read the next command(s) from a running script.
Previously, ksh acted as if EOF was reached, and the script ended normally.
- The '.' and 'source' commands now throw an error if a dot script can be only
partially read, instead of ignoring the error. As ksh reads the entire dot
script before running it, no part of the script is executed in that case.
2023-02-20:
- The SHOPT_RAWONLY compile-time option and the --viraw shell option have been
removed. Ksh's vi editor now always operates in raw mode (but note that "raw
only" was already the default compiled-in behaviour as of 93m+ 2002-03-17).
2023-02-16:
- Fixed a bug in 'cd' with no arguments. When changing the working directory
to the default value ($HOME), it incorrectly used the global scope of the
HOME variable even if a local scope was active.
2023-01-09:
- Fixed a bug causing incorrect greedy ${.sh.match} results when matching
the pattern [^]] in a non-ASCII locale.
- Fixed a crash on initialisation that occurred if ksh was launched from a
parent process with a very high or very low open files limit (ulimit -n).
2023-01-08:
- Fixed a completion bug in vi mode in multibyte character locales, in which
one or more invalid characters were output at the end of the completion if
the cursor was on a "wide" character (or if the last character of the word
is wide and the cursor is in the immediately-following position).
- Fixed a bug in vi and emacs in which using = or * completion from within
a word failed to replace the word; any trailing characters were printed
at the end of the completion. (Bolsky and Korn, pp. 105-106 and 114-115)
2022-10-31:
- In vi mode, issuing the v command from a completely empty line now invokes
the full editor with an empty file instead of beeping.
- Fixed a bug in vi mode where the v command from a line with only whitespace
resulted in an "invalid range" hist error and the editor failed to open.
- Fixed a bug in emacs mode where calling the full editor saved the current
command line to the history file without a terminating newline.
- Fixed a bug in emacs and vi modes where navigating to a null or empty
history line displays an empty line onscreen.
- Fixed a bug in emacs and vi modes where attempting to tab-complete an
alias or $PATH item containing wide characters failed before the first
normal-width character had been entered.
2022-10-28:
- [1.1 change] For security reasons, type attributes of variables are no longer
exported to or imported from the environment. Any script that depends on this
will need to be changed to typeset the expected attributes itself.
2022-10-18:
- Fixed the expansion of out-of-range \n back references in the string part of
${parameter//pattern/string}. For example: v=AB; echo "${v/@(A)B/\0:\1:\2}"
now yields 'AB:A:' instead of 'AB:A:\2'.
- Fixed a corner case regression in the BUG_IFSGLOBS fix applied on 2022-07-28:
unquoted $* was affected. The fix now properly applies only to quoted "$*".
2022-10-14:
- Fixed: the generic --version option was not recognised for the built-in
commands ., bg, disown, fc, fg, hist, jobs, let, source, times, and ulimit.
- Fixed a bug introduced by the 2022-10-07 BUG_BRACQUOT fix, which caused the
fallback string in an expansion like ${emptyvar:-fallback string} to fail to
split into fields correctly if the fallback string contained a !, ^ or -.
- Fixed a few different build errors on Haiku that prevented ksh from compiling
with the mkservice and eloop builtins enabled, caused compiling with -lnetwork
to fail, and could interrupt the build with crash report popups.
2022-10-13:
- Added a -V/--novmon option to ulimit that supports setting the number of open
vnodes (only applies to Haiku).
- Fixed a bug on Haiku that caused the ulimit command to print '(null)' in the
error string when 'ulimit -t' fails.
- 'ulimit -a' no longer exits immediately after an error occurs when failing
to get the current limits for cpu time and file size on Haiku.
2022-10-11:
- Fixed a bug that caused inconsistent behavior when handling a dangling
backslash in a case statement.
2022-10-07:
- Fixed BUG_BRACQUOT: single and double shell quotes did not work to escape
the !, ^ or - operators in a bracket expression within a glob pattern.
- The -e option of test/[/[[ no longer returns true for pseudodevices that are
only supported by the shell and do not in fact exist in the file system, such
as /dev/tcp/*. This reverts a change made in ksh 93u- on 2010-08-24.
2022-09-28:
- Fixed a bug where LINENO was reset to 1 after being temporarily changed in
an assignment preceding a regular command (e.g. LINENO=5 true).
2022-09-27:
- Fixed a parsing bug in (uncommonly used) function definitions of the
form 'functname() simple_command' that could cause the first word of
simple_command to be corrupted with trailing garbage.
2022-09-25:
- Backported support for 'print -u p' from ksh93v- 2014-06-06 (this is
equivalent to using 'print -p').
- Fixed a bug introduced on 2021-04-04 that incorrectly allowed 'typeset' to
turn off the readonly and export attributes on a readonly variable.
- Fixed multiple scoping-related bugs in the += additive assignment operator,
including a bug introduced on 2021-04-11 that caused it to append to the
value of a global variable when used on a local variable with the same name.
2022-09-24:
- The down arrow key can now be used to perform a backwards reverse search,
similar to how the up arrow key functions.
- The Page Up and Page Down keys can now also be used to perform reverse
searches forwards and backwards.
- A new arrowkeysearch shell option can be used to disable backwards reverse
search using the arrow keys. (Page Up and Page Down will still search).
- In the emacs line editor, the Ctrl+R reverse-search prompt is now visually
distinct from a literal control character ("^R: " instead of "^R").
- Fixed a crashing bug involving incorrect data alignment in variables of
types defined by 'typeset -T'.
2022-09-11:
- Fixed a bug introduced in ksh93u+ 2012-04-23 that caused LINENO to have the
wrong value after parsing a multi-line compound assignment.
- Fixed a bug in vi mode that caused reverse search to remain active after
receiving an interrupt.
2022-09-01:
- Fixed a bug where 'command -x' would create a tracked alias for a command,
causing 'whence' not to find an /opt/ast/bin built-in command correctly.
- Fixed a bug in the 'time' keyword where the default precision of a format
specifier (e.g. %lU) was six instead of three, as documented.
2022-08-30:
- When printing a function definition, 'typeset -f function_name' now
regenerates the code from the parse tree instead of dumping the literal
code from the source file. This avoids corrupted or missing output if the
source file is edited or (re)moved after loading the function. It also
makes 'typeset -f' function as a code reformatter (AT&T indentation style).
- In the vi line editor, 'C' and 'c$' at the start of a line now enter insert
mode instead of beeping, and 'I' jumps to the first non-blank character on
the line instead of the start of the line. These changes are consistent
with standard vi(1) behavior and with Bolsky & Korn (1995, p. 121).
- Aliases for many GNU long options have been added to the /opt/ast/bin
built-in commands. Additionally, 'kill -s' now has a --signal long option
alias compatible with the util-linux option.
- All of the /opt/ast/bin built-ins available in src/lib/libcmd (excluding
vmstate if vmalloc isn't enabled) can now be enabled with the new
SHOPT_ALL_LIBCMD setting in src/cmd/ksh93/SHOPT.sh.
2022-08-25:
- In the vi line editor, a bug was fixed that caused erratic behaviour after
using the 0 or ^ commands when already at the beginning of the command line.
2022-08-24:
- Fixed a bug that caused ksh in the vi editor mode to crash or produce
invalid completions if ESC = was used at the beginning of a line. Both
tab and = completions are now disabled at the start of the command line.
- Fixed ksh freezing or using excessive memory if HISTSIZE is assigned a
pathologically large value. A new bounds check makes the theoretical
maximum number of history lines equal to the number of bytes kept in the
history file at cleanup time. On 64-bit systems, that maximum is 16384.
2022-08-20:
- Fixed a bug in command line options processing that caused short-form
option equivalents on some built-in commands to be ignored after one use,
e.g., the new read -a equivalent of read -A (introduced on 2022-02-16).
- Fixed a bug in the /opt/ast/bin/cp built-in command that caused the -r and
-R options to sometimes ignore -P, -L and -H. Additionally, the -r and -R
options no longer follow symlinks by default.
2022-08-16:
- Fixed an old bug in history expansion (set -H) where any use of the history
comment character caused processing to be aborted as if it were an invalid
history expansion. (On 2022-01-24 the history comment character was set to
'#' instead of being disabled by default, which exposed this bug.)
- Fixed a bug introduced on 2022-02-12 that would cause the optional head
builtin's -s option to fail.
2022-08-06:
- Fixed an interactive shell crashing on redefining, then unsetting one of
the predefined aliases.
- Fixed an interactive shell crashing on redefining one of the predefined
aliases, then executing a shell script that does not start with a #! path.
2022-08-05:
- Reverted a buggy exec optimisation introduced on 2022-06-18. It is known
to make the build scripts of GNU binutils produce corrupted results.
2022-08-01:
_ _ ___ _____ ___ ___ ___
| | _____| |__ / _ \___ / _ _ _ _ __ ___ / / | / _ \ / _ \
| |/ / __| '_ \ | (_) ||_ \| | | |_| |_| '_ ` _ \ / /| || | | | | | |
| <\__ \ | | | \__, |__) | |_| |_ _| | | | | |/ / | || |_| | |_| |
|_|\_\___/_| |_| /_/____/ \__,_| |_| |_| |_| |_/_/ |_(_)___(_)___/
- Exactly ten years after ksh 93u+ 2012-08-01, we now have a new ksh release.
Many thanks to all the direct and indirect contributors for their hard work!
(Note: this applies to the 1.0 branch, but seemed worth mentioning here)
2022-07-28:
- Fixed BUG_IFSGLOBS ("$*" does pattern matching if the first character of
$IFS is a wildcard).
2022-07-27:
- Fixed a bug introduced on 2022-02-08 where $PPID was incorrect when a script
without a #! path was executed.
- Fixed a completion bug in the vi line editor. It now correctly completes
the sole member of a directory when tab is pressed immediately after /.
Thanks to K. Eugene Carlson for the report and the fix.
2022-07-26:
- Fixed incorrect handling of initial zeros in test/[ and [[ arithmetic
comparison operators. For example, [[ 0x0A -eq 10 ]] yielded false but
[[ 1+0x0A -eq 11 ]] yielded true.
- Fixed comparing long floating point (typeset -lF) values in test/[ and [[;
the values were reduced to standard floating point before comparing.
2022-07-24:
- Add new 'man' function in src/cmd/ksh93/fun/man. This integrates the --man
self-documentation of ksh built-in and external AST commands with your
system's 'man' command so you can conveniently use 'man' for all commands,
whether built-in or external. To use this, put the file in a directory in
your $FPATH and then issue 'autoload man' in your .kshrc to override the
system's man(1) command. See the file for details.
- Add new 'autocd' function in src/cmd/ksh93/fun/autocd. This activates a
feature like 'shopt -s autocd' in bash: type only a directory name to change.
See the file for details. Add this file to a directory in your $FPATH to use.
- New feature to make 'set -b'/'set -o notify' more usable. When that option
is on (and either the vi or emacs/gmacs line editor is in use), 'Done' and
similar notifications from completed background jobs no longer mess up the
command line you're typing. Instead, the notification is inserted directly
above the line you're typing, without affecting your command line display.
- Fixed a bug that caused the -b/--notify option to only notify on one job if
more than one background job completed at the same time.
- Fixed a bug in the 'command -x' feature introduced on 2021-01-30; it is meant
to always run an external command, but failed to bypass path-bound builtins.
2022-07-21:
- Fixed a bug where a reproducible $RANDOM sequence (after assigning a
specific value to $RANDOM) was influenced by running any external command.
- When an error occurs in a POSIX name() function or a dot script, the
function or script name is now reported in the error message.
2022-07-14:
- Fixed a bug that caused a spurious "Done" message on the interactive shell
when an external command was run as a foreground job from a SIGINT trap.
2022-07-12:
- The .sh.level variable can now only be changed within a DEBUG trap. When
trap execution ends, the variable and the scope are now restored. These
changes disallow an inconsistent shell scoping state causing instability.
2022-07-10:
- Fixed a potential crash on retrieving an empty line from the command history.
- Fixed a potential crash in the lexical analyser on processing single-byte
characters with the highest bit set.
2022-07-09:
- Fixed a bug that broke '[[ ... ]]' test expressions for the command
following a syntax error in an associative array assignment.
2022-07-05:
- Fixed a spurious syntax error on encountering a process substitution
following a redirection without being an argument to a redirection.
For example, this now writes 'OK' to standard error: cat >&2 <(echo OK)
- Fixed the detection of a syntax error in compound assignments to
associative arrays.
2022-07-02:
- Fixed a bug where, if the last command in a subshell was an external
command that was terminated by a signal, the exit status ($?) of the
subshell did not reflect this by adding 256 to the signal number.
- Fixed a bug that caused signal traps to be ignored if the shell was
signalled from a subshell that is the last command in the script.
2022-07-01:
- In scripts, $COLUMNS and $LINES are now kept up to date in scripts at
initialization and when the window size changes (previously, this
required setting a dummy trap for the SIGWINCH signal in the script).
2022-06-28:
- Fixed a bug that caused the <#((num)) or >#((num)) arithmetic seek
redirection operator to fail if used with file descriptor 0, 1 or 2
connected to a block device.
2022-06-22:
- Fixed: 'echo' failed when used inside a command substitution that
is inside a nested compound assignment.
- Fixed a crash in KEYBD trap handling introduced on 2021-11-29.