github.com/lmorg/murex@v0.0.0-20240217211045-e081c89cd4ef/docs/changelog/v2.4.md (about) 1 # v2.4 2 3 This release introduces a strict mode for variables, new builtin, performance improvements, and better error messages; plus a potential breaking change 4 5 There are a number of new features in this release 6 7 ### Breaking Changes: 8 9 * mkarray (`a` et al) no longer returns an error if the start and end ranges 10 are the same. Instead it returns an array of 1 value. 11 12 ### User Facing Changes: 13 14 * Strict variables now supported (like `set -u` in Bash). This will mean any 15 variables passed that haven't been initialized beforehand will cause that 16 pipeline to fail. Currently this is opt in, a future release of Murex will 17 flip that and make it opt out. So take this opportunity to enable it in your 18 `~/.murex_profile` and test your scripts. Enable this via `config`: 19 ``` 20 config: set proc strict-vars true 21 ``` 22 This feature was requested in [issue #380](https://github.com/lmorg/murex/issues/380). 23 24 * New builtin: `datetime`. This builtin allows you to convert date and/or time 25 strings of one format into strings of another format. `datetime` is a 26 supercharged alternative to the UNIX command `date` aimed at making scripting 27 easier. 28 29 * mkarray (`a` et al) now supports dates. eg `[01-Jan-20..05-May-21]`. If no 30 start nor end date appears then mkarray assumes range starts or ends at 31 current date. 32 33 * `openagent` profile for `image` data types has been improved. Murex now 34 better supports tmux and iTerm2. 35 36 * `runtime --config` now displays `FileRef` for every `set` as well as `define`, 37 named `FileRefSet` and `FileRefDefine` respectively. So you can now easily 38 trace where global config is being set and defined. 39 40 * Better error messages in the interactive terminal. 41 42 * Prompt now defaults to only displaying current directory rather than the full 43 path. You can revert this change by adding your own prompt in `config`. eg: 44 ``` 45 config: set shell prompt { 46 out "{RESET}{YELLOW}${pwd_short} {RESET}» " 47 } 48 49 config: set shell prompt-multiline { 50 let len = ${pwd_short -> wc -c} - 1 51 printf "%${$len}s » " $linenum 52 } 53 ``` 54 55 * Parser updated to better support multiline pipelines where the newline is 56 escaped and a comment exists after [issue #379](https://github.com/lmorg/murex/issues/379). 57 This only applies to shell scripts, the interactive terminal hasn't yet been 58 updated to reflect this change. 59 60 * Fixed regression bugs with autocomplete parameters that affected some dynamic 61 blocks. 62 63 * `readline` now caches syntax highlighting and hint text to improve the 64 responsiveness of the interactive terminal. This is set to a hard limit of 65 200 cached items however that will be a configurable metric in a future 66 release. Also planned for the future is caching autocompletion suggestions. 67 68 * Loading message added for the default profile, ie the one that is compiled 69 into and thus shipped with Murex. 70 71 * Fixed bug with `fid-list` and `jobs` where they were outputting the `p.Name` 72 struct rather than `p.Name.String()`. This lead to the process name appearing 73 garbled under some circumstances. 74 75 * `{BG-BLUE}` emitted the wrong ANSI escape code, this has been corrected. 76 77 * Several `readline` bug fixes. 78 79 ### Non-User Facing / Maintenance Changes: 80 81 * Thread safe copying of parameters upon fork. The previous code never actually 82 generated any race conditions and I don't think ever could. However it was 83 ambiguous. This new code makes the copy more explicit and appears to have 84 also brought some minor performance improvements in benchmarks too. 85 86 * Behavioural test framework has been refactored to make it easier to add new 87 behavioural tests. 88 89 * Lots of new tests added. 90 91 * Updated documentation. 92 93 <hr> 94 95 Published: 09.12.2021 at 08:00 96 97 ## See Also 98 99 * [ANSI Constants](../user-guide/ansi.md): 100 Infixed constants that return ANSI escape sequences 101 * [FileRef](../user-guide/fileref.md): 102 How to track what code was loaded and from where 103 * [Modules and Packages](../user-guide/modules.md): 104 An introduction to Murex modules and packages 105 * [Profile Files](../user-guide/profile.md): 106 A breakdown of the different files loaded on start up 107 * [`a` (mkarray)](../commands/a.md): 108 A sophisticated yet simple way to build an array or list 109 * [`config`](../commands/config.md): 110 Query or define Murex runtime settings 111 * [`datetime`](../commands/datetime.md): 112 A date and/or time conversion tool (like `printf` but for date and time values) 113 * [`fid-list`](../commands/fid-list.md): 114 Lists all running functions within the current Murex session 115 * [`ja` (mkarray)](../commands/ja.md): 116 A sophisticated yet simply way to build a JSON array 117 * [`open`](../commands/open.md): 118 Open a file with a preferred handler 119 * [`openagent`](../commands/openagent.md): 120 Creates a handler function for `open` 121 * [`runtime`](../commands/runtime.md): 122 Returns runtime information on the internal state of Murex 123 * [`ta` (mkarray)](../commands/ta.md): 124 A sophisticated yet simple way to build an array of a user defined data-type 125 126 <hr/> 127 128 This document was generated from [gen/changelog/v2.4_doc.yaml](https://github.com/lmorg/murex/blob/master/gen/changelog/v2.4_doc.yaml).