Skip to content

Releases: Edd12321/zrc

v2.7

21 Feb 09:21

Choose a tag to compare

  • Renamed trap and untrap to sig trap, sig untrap;
  • Added sig mask;
  • Added defer;
  • Added /dev/tcp and /dev/udp;
  • Added coproc (coprocesses, like in Bash);
  • Added bindkey -l;
  • Added <> (open for both reading and writing);
  • Added str <s> * <n>;
  • Fixed select behaviour;
  • Fixed arr := not clearing the old array;
  • Fixed @ bugs;
  • Fixed regexp behaviour;
  • Made str complain less, added list -= ...;
  • Less careless error handling;
  • read now consumes separators the same way as sh;
  • Made wait be more than just while (wait(NULL)) {};
  • Made command lookup less slow and fixed other inefficiencies;
  • Nicer job control notifications;
  • Added more demos;
  • Fixed issues regarding named pipe lifetimes;
  • Make the shell escape \cX in lists.

v2.6h

02 Jan 09:45

Choose a tag to compare

Hotfix for v2.6

  • Fixed more job control;
  • Job notifications now show the pipeline on stop/signal;
  • Subshells can now be stopped, resumed, etc. in interactive mode;
  • fn sig<name> replaced with trap/untrap;
  • Added unfn for deleting functions to avoid confusing use of fn with one argument;
  • Added async-safe signal trapping mechanism (achieved with self-pipe trick);
  • Refactor everything to use incremental build;
  • No more semaphores for sync.

v2.6

30 Dec 11:18

Choose a tag to compare

v2.6 Pre-release
Pre-release

This is a big one, boys.

  • Added regex match operator =~ in the str command;
  • fn prompt is now replaced with two variables, $prompt1 and $prompt2;
  • Cygwin support (+ some weird behaviour, and also an .ico);
  • Rewrote a lot of code to use RAII and scope cleanup, replaced old-school C idioms where appropriate;
  • expr overhaul:
    • ** precedence and associativity change;
    • Added hyperbolic trig functions (e.g. sinh, argth), all with their many worldwide aliases;
    • Added symbolic constants e, pi;
    • Total rewrite of this command in pure C++ with a cool X-macro table for the operators, the command no longer relies on flex and bison being installed (which also lead to a slight speedup).
  • Source is now compileable with only a POSIX toolchain plus ISO C++11 (I think);
  • New example scripts in the examples folder, they are now also installed to /usr/share/doc/zrc alongside the LICENSE and README when installing the AUR package;
  • Made break/continue work with repeat;
  • Stuff related to lexing:
    • All looping constructs now cache the lexer's work to avoid redundant parsing;
    • The lexer uses more move semantics than before;
  • Fixed many gnarly job control cases, added semaphores to avoid controlling terminal race;
  • Line editor now uses poll API instead of select, to not break with big FD's;
  • Fixed bugs with lists where certain characters were not escaped;
  • Fixed certain variables crashing the shell when exported;
  • The interpreter now prints an error when a script file contains an unclosed brace/quote/square bracket.

v2.5h

29 Oct 08:43

Choose a tag to compare

v2.5 very small hotfix

  • Fixed some job control bugs regarding SIGHUP;
  • Fixed behaviour when running some programs that take stdin
  • Added disown;
  • $0, $1, ... are now aliases for ${argv 0}, ${argv 1}, etc.

v2.5

25 Oct 09:02

Choose a tag to compare

New update with a bunch of features added!

  • Added .= to set for string concatenation;
  • Added caller command, for Bash style stack traces;
  • Added try/catch and throw;
  • Added logical (non-bitwise) ^^ XOR operator in expr;
  • > actually opens files in O_TRUNC now (rookie mistake);
  • fn prompt no longer forces its output to stderr, user can choose where his prompt goes now;
  • FD management no longer does manual counting, uses fcntl instead;
  • More RAII in the codebase, reducing bugs.

v2.4

09 Oct 21:24

Choose a tag to compare

This is a very big update (also I definitely didn't just steal a bunch of Bash features)

  • Added select like in Bash (new control flow for simple number menus);
  • Added fc, for command correction using an external text editor, as well as histfile juggling (might add history in the future too);
  • Added logout, which is like exit but only works from a login shell session;
  • Added login shell detection: ~/.zrc_(profile/login/logout) scripts get automatically sourced on login/logout now;
  • make install now puts the binary's name in /etc/shells;
  • help command souped up even more, now shows alias definitions;
  • Added $ifs (input field separator)
  • Some bugfixes.

v2.3h

23 Sep 18:13

Choose a tag to compare

Hotfix for v2.3. Not enough features for a full version number

  • Added the getopts command, which works like in Bash, as well as an example. This is probably the only major addition except for some fixes in the codebase
  • Speaking of getopt, the builtins that call it now use RAII to restore its special globals
  • Fixed cd behaviour if home dir not found (potential UB)
  • Removed opportunities for buffer overflows in the code
  • Fixed integer comparisons with NaN
  • Fixed some bugs in regexp, str, read, rlimit, help
  • Reimplemented some ctrl flow to not use goto
  • Builds with clang++ no longer complain with a lot of purple warnings

v2.3

12 Sep 17:30

Choose a tag to compare

A pretty small update, should've called it something else

  • Added apply (lambda functions)
  • Added list map, list filter, list reduce (functional paradigm)
  • Added cot as an alias for ctg in expr evaluator
  • Re-added some old example scripts to the repo
  • Fixed custom signal handler behaviour for SIGINT and SIGTSTP
  • Fixed some minor issues

v2.2

08 Jul 07:56

Choose a tag to compare

v2.2 is now done. Very few bugs remain :)

  • The help command can now output the contents (script) of functions, and it can now list functions as well as builtins.
  • Added Tcl-style unknown command.
  • Re-added regexp.
  • Re-added shift.
  • Job control improved. Scripts can actually be stopped now.
  • Background eval-blocks/non-external commands are handled properly again. All commands are homogenously treated now.
  • New stack-based phrase (logical line) reader, which is more robust and similar to Tcl.

v2.1

04 Apr 08:26

Choose a tag to compare

New version, though a pretty small update. Here's the new stuff in v2.1.

  • Added repeat command (evaluates a floor expression and uses it as a counter)
  • Added sgn as a new expr math function/operator
  • Fixed a buffer bug which could have led to UB
  • Better arrays:
    • Added arr <a> (returns key/value pairs)
    • Added arr <a> keys (returns keys)
    • Added arr <a> vals (return values)
    • Array keys are now sorted by numeric value (if possible), or by string index otherwise

Have fun! ;)