$ account mklement0
ttab is a single-file Bash CLI that programmatically opens new terminal tabs and windows on macOS (Terminal.app and iTerm2) and Linux (gnome-terminal). It supports running startup commands in the new tab, setting working directory, title, and profile, creating iTerm2 horizontal/vertical splits (-v/-h), creating tabs without stealing focus (-g/-G), delaying command submission (-l), and clearing the screen (-q). The entire application is bin/ttab: a ~700-line Bash script with zero runtime dependencies that parses options via getopts, detects the calling terminal through TERM_PROGRAM / GNOME_TERMINAL_SCREEN or an explicit -a flag, synthesizes backend-specific automation (AppleScript for Terminal.app and iTerm2, with distinct v2/v3 syntax paths, and a CLI argument string for gnome-terminal), and executes it via 'exec osascript' on macOS or eval on Linux. It embeds its full Markdown man page as a here-doc extracted by sed, so --help, --man, and --man-source all work from the single distributed file.