Enable (default) or disable ANSI colour support at runtime. Returns the previous state.
Example:
# Example for ansi prev = ansi(true) println "ANSI mode was: " + as_string(prev) ansi(false)
CLI argument count.
Example:
# Example for argc println argc()
CLI arguments as an array.
Example:
# Example for argv
try
println argv(0)
catch err
println "No command-line arguments available"
endtry
Set colour scheme for array depth formatting and return previous colours.
Example:
# Example for array_colours println array_colours(["[#red]", "[#green]", "[#blue]"])
Enable/disable pretty array formatting. Default: false, enabled in interactive mode.
Example:
# Example for array_format array_format(true)
Return tokenised phrase representation.
Example:
# Example for ast
println ast("println 42")
Blocks until every async task in the handle map has begun executing. Returns the total time blocked in microseconds, or nil if the map is empty. Errors if the handle map is undeclared.
Example:
# Example for async_wait_startup
try
var h = map(.job 1)
async_wait_startup(h)
catch err
println "Async wait failed"
endtry
Checks for async completion.
Example:
# Example for await var h = map(.job 1) println await(h)
Returns the major version number of the Bash co-process.
Example:
# Example for bash_versinfo println bash_versinfo()
Returns the full release string of the Bash co-process.
Example:
# Example for bash_version println bash_version()
Select if | and =| commands should capture output.
Example:
# Example for capture_shell println capture_shell(true)
Clear to the end of the line, starting at row,col in the current pane.
Example:
# Example for clear_line
try
clear_line(0, 0)
catch err
println "Clear line failed"
endtry
Get clock ticks from aux file.
Example:
# Example for clktck println clktck()
Select if | and =| commands should execute in the coprocess (true) or the current Za process (false).
Example:
# Example for coproc println coproc(true)
Disables cursor display.
Example:
# Example for cursoroff cursoroff()
Enables cursor display.
Example:
# Example for cursoron cursoron()
Moves cursor to horizontal position n.
Example:
# Example for cursorx cursorx(10)
checks if a constant, variable, or map key is defined in the current scope or USE chain
Example:
# Example for defined
myvar = 42
println defined("myvar")
Displays in-scope variable list.
Example:
# Example for dump println dump()
returns a duplicate copy of argument 1.
Example:
# Example for dup println dup(map(.a "1", .b "2"))
Enable or disable local echo. Optionally, set the mask character to be used during input.
Current visibility state is returned when no arguments are provided.
Example:
# Example for echo echo(true) # usage
returns the values associated with enumeration enum
Example:
# Example for enum_all
enum fruits(apple, banana, cherry)
println enum_all("fruits")
returns the name labels associated with enumeration enum
Example:
# Example for enum_names
enum fruits(apple, banana, cherry)
println enum_names("fruits")
evaluate expression in string.
Example:
# Example for eval
println eval("1 + 1")
execute code in string.
Example:
# Example for exec
try
exec("println 42")
catch err
println "exec not permitted"
endtry
Returns the initial working directory.
Example:
# Example for execpath println execpath()
returns true if the arguments satisfy the type list.
a variant is an argument count followed by a list of type_strings.
Example:
# Example for expect
try
expect(true, "test")
catch err
println "Expect failed"
endtry
Register a new exception type in the ex enum with severity level. Returns true if successful, false if exception already exists. Severity levels: emerg, alert, crit, err, warn, notice, info, debug. Used to override default LOG level during exception handling.
Example:
# Example for exreg
println exreg("my_error", "warn")
formats a stack trace array into a readable string with numbered frames.
Example:
# Example for format_stack_trace
try
panic("test")
catch err
println format_stack_trace(err["stack_trace"])
endtry
Returns a list of standard library functions.
Example:
# Example for func_categories println func_categories()
Returns a list of standard library function descriptions.
Example:
# Example for func_descriptions println func_descriptions()
Returns a list of standard library function inputs.
Example:
# Example for func_inputs println func_inputs()
Returns a list of standard library function outputs.
Example:
# Example for func_outputs println func_outputs()
Find a function handle.
Example:
# Example for funcref
def myfunc()
return 42
endfunc
println funcref("myfunc")
println funcref("nonexistent_function")
Returns a list of standard library functions.
Example:
# Example for funcs
println funcs("", true)
reads the column position of console text cursor.
Example:
# Example for get_col println get_col()
Returns the CPU core count.
Example:
# Example for get_cores println get_cores()
Returns the current heap allocated memory and total system memory usage in MB.
Structure fields are .alloc and .system for allocated space and total system space respectively.
Example:
# Example for get_mem get_mem() # usage
reads the row position of console text cursor.
Example:
# Example for get_row println get_row()
Check if tty supports at least 16 colours.
Example:
# Example for has_colour println has_colour()
Check if a child co-process has been launched.
Example:
# Example for has_shell println has_shell()
Check if executing with a tty.
Example:
# Example for has_term println has_term()
Returns the home directory of the user that launched Za as reported by the coprocess.
Example:
# Example for home println home()
Returns the current hostname.
Example:
# Example for hostname println hostname()
Returns a list of import errors for an AUTO module. Each error message describes a struct/union that was skipped due to unresolvable fields. Returns empty list if no errors.
Example:
# Example for import_errors
println import_errors("nonexistent_module")
Returns true if an AUTO module import had any errors (structs skipped). Useful for quick checks before using optional structs.
Example:
# Example for import_has_errors
println import_has_errors("nonexistent_module")
Enable (default) or disable string interpolation at runtime.
This is useful for ensuring that braced phrases remain unmolested. Returns the previous state.
Example:
# Example for interpol interpol(true) # usage
Does key key_name exist in associative array ary_name?
Example:
# Example for key
mydata = map(.name "Alice", .age 30)
println key("mydata", "name")
println key("mydata", "city")
Returns an integer corresponding with a keypress.
Internally, the minimum timeout value is currently 1 decisecond.
See the termios(3) man page for reasoning about VMIN/VTIME.
Example:
# Example for keypress keypress() # usage
Returns the locale name used within the coprocess.
Example:
# Example for lang println lang()
Returns the last received error code from a co-process command.
Example:
# Example for last println last()
Returns the last received error text from the co-process.
Example:
# Example for last_err println last_err()
Returns length of string or list.
Example:
# Example for len println len([1, 2, 3, 4, 5])
Return this local variable's value.
Example:
# Example for local
try
println local("myvar")
catch err
println "local variable not found"
endtry
Returns logging queue status: .used: current queue usage, .total: queue size, .running: worker status, .percentage: usage percentage
Example:
# Example for log_queue_status println log_queue_status()
Returns comprehensive logging statistics: .queue_used: current queue usage, .queue_total: queue size, .queue_running: worker status, .main_processed: main log requests processed, .web_processed: web access log requests processed
Example:
# Example for logging_stats println logging_stats()
Displays global variable list.
Example:
# Example for mdump mdump()
Returns the kernel version name as reported by the coprocess.
Example:
# Example for os println os()
Returns the current pane start column.
Example:
# Example for pane_c println pane_c()
Returns the current pane height.
Example:
# Example for pane_h println pane_h()
Returns the current pane start row.
Example:
# Example for pane_r println pane_r()
Returns the current pane width.
Example:
# Example for pane_w println pane_w()
Calls Go's built-in panic() with the specified message. This tests the panic-to-exception conversion system when error_style() is set to 'exception' or 'mixed'.
Example:
# Example for panic
try
panic("test")
catch err
println "Caught panic"
endtry
Set a run-time behaviour... uninit: should stop for uninitialised variables / dupmod: ignore duplicate imports
exitquiet: shorter error message / shell: permit shell commands / eval: permit eval() calls
interpol: permit string interpolation / cmdfallback: shell call on eval failure (interactive)
permit: enable/disable permit() / exception_strictness: enable/disable exception_strictness call
macro: enable/disable macro statement / sanitisation: enable/disable the sanitisation_enable() call
Example:
# Example for permit
permit("error_exit", true)
Return the pid of the current process.
Example:
# Example for pid println pid()
Return the pid of parent process.
Example:
# Example for ppid println ppid()
Returns the /etc derived release name.
Example:
# Example for release_id println release_id()
Returns the OS release name as reported by the coprocess.
Example:
# Example for release_name println release_name()
Returns the OS version number.
Example:
# Example for release_version println release_version()
Returns length of string in runes.
Example:
# Example for rlen
println rlen("hello")
println rlen("hello \u4e16\u754c")
Sets the maximum directory recurse depth in interactive help mode.
Example:
# Example for set_depth set_depth(5)
Get process ID of the launched child co-process.
Example:
# Example for shell_pid println shell_pid()
returns the size of an object.
Example:
# Example for sizeof println sizeof([1, 2, 3, 4, 5])
Executes command string and returns a command structure (bool==false) or displays (bool==true) the output.
Example:
# Example for system
println system("echo hello world", false)
Returns the value of a system variable.
Example:
# Example for sysvar
println sysvar("home")
println sysvar("unknown_var")
Returns the OS reported terminal type.
Example:
# Example for term println term()
Returns the current terminal height.
Example:
# Example for term_h println term_h()
Returns the current terminal width.
Example:
# Example for term_w println term_w()
Find this function's name.
Example:
# Example for thisfunc println thisfunc()
Find this function's handle.
Example:
# Example for thisref println thisref()
Returns a structure containing a list of tokens (.tokens) in a string and a list (.types) of token types.
Example:
# Example for tokens
println tokens("hello world 42")
set a responding function for a given trap type.
Currently supported trap types: int, error
Example:
# Example for trap
def cleanup()
println "**break"
exit 1
end
trap("int", "cleanup()")
while
pause 1000
endwhile
Remove a map key. Returns true on successful removal.
Example:
# Example for unmap
m = map(.a 1, .b 2)
println unmap("m", "a")
Returns the parent user of the Bash co-process.
Example:
# Example for user println user()
Is the current language utf-8 compliant? This only works if the environmental variable LANG is available.
Example:
# Example for utf8supported println utf8supported()
returns the name binding uint for a variable.
Example:
# Example for varbind
try
println varbind("myvar")
catch err
println "varbind failed"
endtry
Is this a WSL terminal?
Example:
# Example for winterm println winterm()
internal info: .version: semantic version number, .name: language name, .build: build type
Example:
# Example for zainfo println zainfo()
Returns the zsh version string if present.
Example:
# Example for zsh_version println zsh_version()