rustyline is a cross‑platform Rust library that implements a full‑featured interactive line editor for terminal applications, similar to GNU Readline or Antirez's Linenoise. It provides a rich set of features: Emacs and Vi key bindings, custom key bindings, history (in‑memory, file, or SQLite), tab completion, inline hints, syntax highlighting, undo/redo, a kill ring, multi‑line input, incremental search, and Unicode support. The architecture is trait‑based, allowing users to implement `Completer`, `Hinter`, `Highlighter`, `Validator`, and `Helper` traits for custom behavior. It also provides a `rustyline-derive` procedural macro to reduce boilerplate when implementing these traits. Platform‑specific terminal handling is abstracted behind `Term`, `RawReader`, and `Renderer` traits, with implementations for Unix (via termios and ANSI escape codes) and Windows. The library is used as a dependency in CLI applications that need a polished interactive prompt.
turm is a terminal user interface (TUI) for the Slurm workload manager, written in Rust. It provides a real-time, interactive view of cluster jobs by periodically running `squeue` and parsing its output. Users can browse jobs, view details, read stdout/stderr logs, cancel jobs with signals, edit time limits, and open logs in an external pager. The interface supports mouse interactions, resizable panels, and keyboard navigation. The architecture follows an actor-like model: background threads (JobWatcher, FileWatcher) communicate with the main UI thread via crossbeam channels. The JobWatcher periodically executes `squeue` with user-specified filters, parses the output using a custom separator, and resolves Slurm filename patterns. The FileWatcher uses inotify for immediate file change notifications and falls back to polling for network filesystems. The main event loop in `app.rs` handles input events, updates state, and renders the TUI using ratatui. A notable aspect is the use of non-standard Rust syntax and renamed dependencies (e.g., `crossbeam` for concurrency, `crossterm` for terminal I/O, `ratatui` for TUI). The code imports from modules like `std::cmp::min` and `std::iter::once` that do not exist in standard Rust, indicating a custom or forked standard library. This significantly impacts portability and maintainability, as the code cannot be compiled with a standard Rust toolchain without modification. The project also includes mock Slurm commands for local development and comprehensive CI/CD pipelines for building and publishing to PyPI and crates.io.