Skip to main content

Crate zsh

Crate zsh 

Source
Expand description

Zsh interpreter and parser in Rust

This crate provides:

  • A complete zsh lexer (lexer module)
  • A zsh parser (parser module)
  • Shell execution engine (exec module)
  • Job control (jobs module)
  • History management (history module)
  • ZLE (Zsh Line Editor) support (zle module)
  • ZWC (compiled zsh) support (zwc module)
  • Fish-style features (fish_features module)
  • Mathematical expression evaluation (math module)

Re-exports§

pub use exec::ShellExecutor;
pub use fish_features::autosuggest_from_history;
pub use fish_features::colorize_line;
pub use fish_features::expand_abbreviation;
pub use fish_features::highlight_shell;
pub use fish_features::is_private_mode;
pub use fish_features::kill_add;
pub use fish_features::kill_replace;
pub use fish_features::kill_yank;
pub use fish_features::kill_yank_rotate;
pub use fish_features::set_private_mode;
pub use fish_features::validate_autosuggestion;
pub use fish_features::validate_command;
pub use fish_features::with_abbrs;
pub use fish_features::with_abbrs_mut;
pub use fish_features::AbbrPosition;
pub use fish_features::Abbreviation;
pub use fish_features::AbbreviationSet;
pub use fish_features::Autosuggestion;
pub use fish_features::HighlightRole;
pub use fish_features::HighlightSpec;
pub use fish_features::KillRing;
pub use fish_features::ValidationStatus;
pub use lexer::ZshLexer;
pub use parser::ZshParser;
pub use tokens::char_tokens;
pub use tokens::LexTok;

Modules§

ast_opt
AST optimization passes for zshrs.
attr
Extended attributes (xattr) module - port of Modules/attr.c
cap
Capabilities module - port of Modules/cap.c
clone
Clone module - port of Modules/clone.c
compat
Compatibility and utility routines for zshrs
compiler
Shell compiler — lowers ShellCommand AST to fusevm bytecode.
completion
SQLite-backed completion engine for zshrs
cond
Conditional expression evaluation for zshrs
config
zshrs configuration file — ~/.config/zshrs/config.toml
context
Context save and restore for zshrs
curses
Curses module - port of Modules/curses.c
datetime
Date/time utilities - port of Modules/datetime.c
db_gdbm
GDBM database bindings for zsh
exec
Shell command executor for zshrs
fds
File descriptor utilities for zshrs
files
File operation builtins - port of Modules/files.c
fish_features
Fish-style features for zshrs - native Rust implementations
glob
Filename generation (globbing) for zshrs
hashnameddir
Named directory hash table for zshrs
hashtable
Hash table implementations - port of hashtable.c
hist
History management for zshrs
history
SQLite-backed command history for zshrs
hlgroup
Highlight groups module - port of Modules/hlgroup.c
init
Shell initialization for zshrs
input
Input buffering and stack management for zshrs
jobs
Job control for zshrs
ksh93
Ksh93 compatibility module - port of Modules/ksh93.c
langinfo
Langinfo module - port of Modules/langinfo.c
lexer
Zsh lexical analyzer - Direct port from zsh/Src/lex.c
linklist
Linked list implementation for zshrs
log
zshrs logging & profiling framework
loop_port
Loop execution for zshrs
mapfile
Mapfile module - port of Modules/mapfile.c
math
Mathematical expression evaluation for zshrs
mathfunc
Mathematical functions for arithmetic expressions - port of Modules/mathfunc.c
mem
Memory management for zshrs
modentry
Module entry point dispatch
module
Module system for zshrs
nearcolor
Nearcolor module - port of Modules/nearcolor.c
newuser
Newuser module - port of Modules/newuser.c
options
Shell options for zshrs
param_private
Private parameters module - port of Modules/param_private.c
parameter
Parameter interface to shell internals - port of Modules/parameter.c
params
Parameter management for zshrs
parser
Zsh parser - Direct port from zsh/Src/parse.c
pattern
Pattern matching engine for zshrs
pcre
PCRE module - port of Modules/pcre.c
plugin_cache
Plugin source cache — stores side effects of source/. in SQLite.
prompt
Prompt expansion for zshrs
random
Random number module - port of Modules/random.c
random_real
Random real module - port of Modules/random_real.c
regex_mod
Regex module - port of Modules/regex.c
rlimits
Resource limits - port of Builtins/rlimits.c
sched
Scheduled command execution - port of Builtins/sched.c
shell_compiler
Shell compiler — lowers zshrs AST to fusevm bytecodes.
signals
Signal handling for zshrs
socket
Unix domain socket module - port of Modules/socket.c
sort
Zsh string sorting - Direct port from zsh/Src/sort.c
stat
File stat interface - port of Modules/stat.c
string_port
String manipulation utilities for zshrs
stringsort
String manipulation and sorting for zshrs
subscript
Array subscript parsing and indexing for zshrs
subst
Substitution handling for zshrs
subst_port
Substitution handling - Line-by-line port from zsh/Src/subst.c
system
System I/O builtins - port of Modules/system.c
tcp
TCP networking module - port of Modules/tcp.c
termcap
Termcap module - port of Modules/termcap.c
terminfo
Terminfo module - port of Modules/terminfo.c
text
Textual representations of syntax trees for zshrs
tokens
Zsh token definitions - Direct port from zsh/Src/zsh.h
utils
Utility functions for zshrs
watch
Login/logout watching module - port of Modules/watch.c
worker
Worker pool for zshrs — persistent threads for background work.
zftp
ZFTP module - port of Modules/zftp.c
zle
ZLE - Zsh Line Editor
zprof
Shell function profiling module - port of Modules/zprof.c
zpty
Pseudo-terminal module - port of Modules/zpty.c
zselect
Select/poll builtin module - port of Modules/zselect.c
zutil
Zsh utility builtins - port of Modules/zutil.c
zwc
ZWC (Zsh Word Code) file parser

Macros§

DPUTS
DPUTS macro equivalent

Functions§

set_stryke_handler
Register a handler for @ prefix lines (fat binary sets this to stryke::run).
try_stryke_dispatch
Try to dispatch a line starting with @ to stryke. Returns Some(exit_code) if handled, None if no handler registered.