Skip to content
inxbitPublic

About

Fast terminal output highlighter focused on network devices and Unix systems

Topics

Resources

Contributing

Security policy

Stars

5 stars

Watchers

0 watching

Forks

Repository files navigation

PrismTTY

PrismTTY

website crates.io docs.rs CI release license

PrismTTY makes dense SSH, network-device, and Unix/Linux terminal output easier to scan in real time. It is a fast ChromaTerm-style CLI wrapper with network-focused built-in profiles.

Website: prismtty.com.

Quick Demo

Animated PrismTTY terminal demo

Preview

Real PrismTTY output over synthetic fixtures (invented hosts, documentation-range addresses):

Highlighted PrismTTY terminal output

Dynamic PrismTTY profile switching

What This Is / What This Is Not

PrismTTY is a live terminal-output highlighter for shells, SSH sessions, pipes, and logs.

It highlights output that is already flowing through your terminal, including:

  • prompts
  • interfaces
  • IP addresses
  • protocol state
  • counters
  • severity
  • common vendor terms

PrismTTY is not:

  • an NMS
  • a configuration-management tool
  • a source of truth
  • a SIEM
  • a log platform
  • a device inventory system

It does not log in to devices by itself, collect inventory, push configuration, or store operational data.

Install

PrismTTY builds and is tested on macOS and Linux. Every install method provides the same three commands: prismtty, plus the ptty and ct aliases. All three run the same binary; ct matches ChromaTerm's command name so existing ChromaTerm habits and scripts keep working.

Homebrew

Install the latest release from the PrismTTY Homebrew tap:

brew install inxbit/tap/prismtty

The Homebrew formula installs prismtty, ptty, ct, bundled profiles, and shell completions. It also installs the required PCRE2 runtime dependency.

If another package already owns ct in the Homebrew prefix (the chart-testing and coreos-ct formulae install one), the formula leaves its own ct unlinked under libexec, keeps the name out of the completions it installs, and says so at the end of the install; prismtty and ptty are linked as usual. The choice is made when PrismTTY is installed. If the other package arrives later, its link step stops at PrismTTY's ct, and unlinking PrismTTY as Homebrew then suggests removes all three commands; run brew link --overwrite for the other package instead, then brew reinstall inxbit/tap/prismtty. If an earlier PrismTTY install stopped at the link step, run brew link prismtty after upgrading: Homebrew keeps a formula unlinked across an upgrade or a reinstall.

Cargo

Install from crates.io:

cargo install --locked prismtty

Cargo builds PrismTTY from source and installs the command binaries. You need Rust 1.85 or newer plus PCRE2 and pkg-config available on your system. --locked builds with the dependency versions audited for the release.

For cargo install on macOS, install the native build dependencies first:

brew install pcre2 pkg-config

For cargo install on Debian/Ubuntu, install:

sudo apt-get install libpcre2-dev pkg-config

Cargo installs the binaries only. Shell completions for zsh, bash, and fish live in completions/; copy the file for your shell into its completions directory.

For fish, also link prismtty.fish under the ptty and ct names, because fish only loads a completion file named after the command being completed:

cd ~/.config/fish/completions
ln -s prismtty.fish ptty.fish
ln -s prismtty.fish ct.fish

The bash-completion on-demand directory works the same way: install prismtty.bash there as prismtty, ptty, and ct, or source it from ~/.bashrc.

GitHub Release

Prebuilt release archives and checksums are available on the latest release page.

Each release archive contains the binaries, license/readme files, example profiles, and shell completions. Its .tar.gz.sha256 checksum is a separate file next to it on the release page. The binaries load PCRE2 at run time: from Homebrew (brew install pcre2) on macOS, and from the system libpcre2-8 on Linux. The Linux binaries require glibc 2.34 or newer and any x86-64 CPU, are built and tested on Ubuntu 22.04, and load the system's libpcre2-8.so.0 and libgcc_s.so.1.

Build Locally

Build from a checkout with:

cargo build --release

The project builds these user-facing binaries:

  • prismtty
  • ptty
  • ct

Release packages can be built with:

scripts/package-release.sh

The release workflow generates a Homebrew formula from the actual release checksums and uploads it as prismtty.rb with the release artifacts. The published tap formula lives in inxbit/homebrew-tap.

Usage

ptty /bin/zsh
ptty ssh router.example.net
prismtty --profile cisco < show-tech.txt
prismtty profiles test cisco fixtures/cisco.txt
prismtty --reload

The recommended interactive workflow is to start one wrapped shell from your terminal profile:

ptty /bin/zsh

From inside that shell, run normal ssh, telnet, or console-wrapper commands. PrismTTY dynamically switches profiles from observed login banners and prompts, then keeps the selected remote profile locked for the session. Normal command output such as interface descriptions cannot churn the profile in the middle of the session. Nested remote sessions are still supported: a typed remote-jump command arms the next strong banner or repeated prompt to push a new profile, and connection-close markers pop back to the previous profile. If a connection attempt fails with a message PrismTTY does not recognize and a device prompt follows it, a later close line that names an outer host can leave the remote profile active. After you leave a device whose name holds a vendor's name, such as junos-sw1, its colors can come back at the prompt you returned to when PrismTTY reads the start of the client's close line before the line is complete, for example when other output and that start arrive together and the rest of the line follows later: a line of text and Connection to junos-sw1 in one read, then closed.. The same happens when you type a key between the logout and the start of the close line. The colors stay until other device output or the end of another connection replaces them.

Leaving a device that you reached from another device returns to the first device's colors when the output shows the end of that connection. After you type or paste exit, quit or logout, or press Ctrl-D on an empty line (a line edited with the arrow keys, Tab, Ctrl-W or another control key, or recalled from history, does not count; Backspace and Ctrl-U do), PrismTTY needs [Connection to NAME closed by foreign host], where NAME is the host you typed in the ssh, mosh or telnet command, and then, as the first prompt after it, exactly the prompt you were at when you opened that connection, ending within the first 512 bytes after the echo of your exit line (bytes as received, escape sequences not counted), with both lines within 3 seconds. A complete prompt line confirms at once, unless it follows an Enter alone. Output in the read that brings that prompt is not used to recognize a device: a banner the parent prints there counts when it arrives again. A waiting prompt confirms when the next line you type there, with at least one character before its Enter, is followed by exactly the bytes you typed, with nothing else shown in between and your Enter matched by a carriage return or a line feed. The colors change at that line end: the prompt line and the part of the command shown before it are drawn in the colors of the device you left, unless the echo comes in the same read as the line end, as in a paste; everything after the line end is read in the parent's colors like any output, so a banner there switches to the next device. An Enter alone does not confirm; the next line typed at the prompt shown again for it does, if that prompt still ends within the 512 bytes after the echo of your exit line. At a waiting prompt, Backspace, Ctrl-U, Tab, Ctrl-C, other output, and a parent that does not echo keep the child's colors, as do keys typed before the prompt appeared. After Ctrl-] and quit (or q, qu, qui) in telnet, PrismTTY needs telnet's own telnet> quit line (or the shorter word you typed) within 4,096 bytes, ending after your Enter, then Connection closed. or Connection closed as the first non-blank line within 256 bytes, with no time limit, and every telnet in the chain must have announced its escape character (Escape character is '^]'.). A telnet that drops with a bare Connection closed. keeps its colors. The close messages PrismTTY already recognized, such as Connection to NAME closed. or Connection closed by foreign host., still end a connection as before, and Shared connection to NAME closed., which ssh prints through a shared connection (ControlMaster), now does too. These lines are trusted, and the bytes after the prompt cannot show which program printed them: a device, or a logout script on it, that prints the bracket and the exact parent prompt while you are still connected, such as a saved session log, switches the colors early, as does one that prints the bracket and the exact parent prompt and then exactly the bytes you type. A program you run inside a connection that shows ssh's own close line on a line of its own, such as a tool that runs ssh for you on a jump host, can end that connection's colors early in the same way when no ssh was typed inside that connection. Only colors change, except that with --show-profile and an unread stderr, the confirming read, and terminal output with it, waits until stderr drains.

After a command you run at the local shell switches the colors, such as cat of a saved device log, the laptop's colors may come back after the shell's next prompt, if these checks pass: that command's own job has ended and the shell has no other job left. PrismTTY checks once the prompt has been quiet for 250 ms, or at your next key, and the check can decline; anything it cannot find out counts as no, and the changelog lists each check. A prompt's helper whose parent has ended and that is not in the shell's own process group, such as powerlevel10k's gitstatusd, does not hold the colors back. The colors stay as before while the shell has any job in the background or stopped, for commands that run no job of their own (builtins, job control off), after a line that starts with exec, and for sessions opened by typing ssh, mosh, telnet, screen, cu, minicom or picocom. The screen that ships with macOS prints [detached] when you detach, which is not a close line PrismTTY knows ([screen is terminating] and [detached from NAME] are), so the colors of a device shown inside it can stay at the laptop's prompt after a detach. When a job has made a check decline and then ends, the colors do not come back while nothing more is drawn: the next check comes with the same prompt drawn again, with the end of a later command, or with your next key if it was the listing of the shell's processes that did not prove the shell alone. A line you start typing after other output has followed the prompt is not checked; the colors can come back when the next command that runs a program, typed at a drawn prompt, ends, if the checks pass. A program started at the moment the colors come back (its line entered while the check runs, or pasted with its Enter) can start in the laptop's colors, as one started just after, and is colored once it identifies itself. PrismTTY cannot tell which program wrote a line: a program that is no longer the shell's job (it left the shell's session, or the process that started it has ended) and keeps writing to the terminal is drawn in the laptop's colors once the prompt is back, even while it is still connected; ssh -f and screen -dm leave the job on purpose. Only colors change, with the same --show-profile exception.

Interactive mode is designed to preserve shell line editing and typed command echo, including zsh prompts that use decorative Unicode prompt markers such as ╰─○, ❯, or ➜. Output that stops on a byte that could begin a UTF-8 character, such as a Latin-1 é (byte E9), is held: the byte is shown when more output arrives or the output ends.

Use stdin mode for noninteractive output from files or pipes:

prismtty --profile cisco < show-tech.txt
journalctl -xe | prismtty --profile linux-unix

When PrismTTY reads a file or a pipe, highlighting pauses while the alternate screen that full-screen programs such as less and vim draw on is active, and resumes when that screen is closed or the terminal is reset. Output that ends before then, such as a log cut off while a pager was open, stays unhighlighted from the switch on.

A wrapped command runs in the current directory. Descriptors above 2 that the caller passes (ptty cmd 3<file, ptty diff <(a) <(b)) reach the command as they would without the wrapper. When stdin is not a terminal (a script, a CI job, or ptty make < /dev/null), the command reads that stdin directly while its output still goes through the PTY and is highlighted. If the command cannot be found or run, PrismTTY exits with 127 or 126, as a shell does; otherwise it exits with the command's own status. When the output goes to a regular file (ptty make > build.log), or to a pipe while stdin is not a terminal, the command's PTY starts with output processing off, so LF and CR LF line ends are saved as the command wrote them; the command can change that setting. With the keyboard on a terminal and the output in a pipe (ptty ssh host | tee log) the PTY keeps its usual output settings, because the pipe usually leads back to that terminal. With stdin redirected and the output on a terminal (ptty make </dev/null), the PTY keeps its usual settings too, so a recording of that terminal's output holds an extra carriage return on each line (CR CR LF); on screen the lines look the same. This is on purpose: the PTY ends each line with CR LF itself, so the lines still start at the left edge if another program turns off the terminal's output processing during the session.

On macOS, if a command revokes its PTY and reopens the same terminal, PrismTTY keeps one highlighting stream across the transient zero-byte master read. While the command's exit has not been reported, it waits up to 20 milliseconds between such reads. After a revoke, a typed Ctrl-C may not signal the command; ending signals sent to PrismTTY still use the signal-forwarding behavior described below.

A command killed by a signal is reported as 128 plus the signal number, as a shell does, with one exception: when SIGINT (Ctrl-C) kills the command, PrismTTY ends by SIGINT too, after restoring the terminal, so a loop typed at a shell prompt stops after one Ctrl-C as it does without PrismTTY. In a shell $? is still 130; a program that reads the wait status sees the signal (Python's subprocess reports -2, make prints Interrupt). PrismTTY keeps 130 when it was started with SIGINT ignored or blocked. A script that runs with the terminal on its stdin, and a zsh or dash pipeline where PrismTTY is not the last command, still go on after one Ctrl-C, because those shells stop only when they receive the Ctrl-C themselves and PrismTTY, holding the terminal in raw mode, receives it instead.

When PrismTTY itself is sent a signal that ends it, such as SIGTERM, SIGHUP, SIGINT or SIGQUIT, and the command is still running, PrismTTY passes the signal on to the command's process group. It kills what is left of that group as soon as the command exits. After two seconds, unless the signal already sent was SIGHUP, it sends SIGHUP and waits up to 300 milliseconds so a shell can hang up its other jobs; it then kills what remains. When the signal sent to PrismTTY was SIGHUP, there is no second hangup or extra 300-millisecond wait: it kills what remains at two seconds. If PrismTTY sees, before it sends the late SIGHUP, that the command exited by itself (its wait status is an ordinary exit, even one that came near the end of those two seconds), PrismTTY, which gives the terminal back as soon as it takes the signal, as before, then draws the output that reached it and exits with the command's exit code, so a command that cleans up on SIGTERM and exits 0 gives 0. An exit right at the two seconds races the late SIGHUP. If the command's ordinary exit was not seen before that SIGHUP was sent, or the command was killed by a signal or could not be collected, or that normal end does not complete within about four seconds of the signal, the end is abrupt, as before: PrismTTY exits with 128 plus the signal it was sent, and output not yet drawn can be lost. It ends by SIGINT instead when it was sent SIGINT and the command died from it, so a command that dies from SIGINT after PrismTTY was sent SIGTERM still gives 143. The four seconds count while PrismTTY is not stopped; on macOS a PrismTTY that leads its terminal's session also waits, as it exits, while output it wrote to that terminal is still unread. When PrismTTY returns the command's exit code, it describes the command PrismTTY started, not the rest of its process group: 0 does not mean that every process in the group finished cleanly. PrismTTY acts on the first such signal recorded before the final pending-signal check in its shutdown handoff, including one recorded while the session is ending; a later recorded one does not replace it. If none is recorded by that check, PrismTTY gives the signals back to their previous actions, except for the formerly default macOS stop actions described below.

SIGABRT, SIGTRAP, SIGILL, SIGFPE, SIGSYS, SIGBUS, SIGSEGV and, on macOS, SIGEMT cannot run that deferred cleanup safely. When PrismTTY has put a terminal in raw mode, a last-chance handler makes a best-effort attempt to restore the complete saved terminal mode, puts back the default action, and sends the signal again to the thread that handled it. This normally keeps a signal wait status and, where the system records one, the handling thread, but it may not preserve the original fault address in a core file. If the thread-directed send fails, PrismTTY falls back to a process-directed send. If the default action cannot be installed or neither send succeeds, PrismTTY exits with 128 plus the signal number instead. A Rust stack overflow still prints Rust's report and ends in SIGABRT. This path does not draw buffered output or tear down the command. Closing the PTY master sends the command a hangup; a command that ignores that hangup can keep running without PrismTTY.

PrismTTY restores only when it owns the terminal foreground at the check; ownership can change between that check and the terminal write. A failed terminal write can still leave raw mode behind. A signal disposition that PrismTTY leaves alone because it was ignored or already handled when the session began has no promised last-chance restore.

Give-back and any reinstallation of PrismTTY's handlers each use one sigaction per signal, so a signal during either transition can take the given-back action or reach PrismTTY's handler. The given-back action is normally the previous action, with the same macOS stop-action exception. SIGUSR1 and SIGUSR2 are given back last and never once such a signal is recorded. When such a signal is recorded just after they were given back, PrismTTY first puts its handler back on those of them it had caught, unless that sigaction fails; one of them that is being delivered as that happens can still take its previous action. A handler that entered earlier but records such a signal only after the final check has no taker; that signal does not change the session's otherwise determined result. After give-back completes without reinstallation, later signals take the actions it installed: their previous actions except for those macOS stop actions. On macOS, PrismTTY never changes the inherited SIGCONT action during a PTY session and observes delivered continues through kqueue. An inherited ignored action remains ignored, and an inherited caught handler can still run with its own mask and behavior. A direct continue makes PrismTTY recheck raw mode and terminal size but is not forwarded to the wrapped command. Several continues can coalesce into one such recheck. Normally, one continue sent after both PrismTTY and its command have been observed stopped resumes the supervised stop. macOS can report a stop a moment before the process is suspended; a continue sent in that moment can be lost by the system, and another continue then resumes it. A continue delivered before or across the stop may also require another continue.

On macOS, when SIGTSTP, SIGTTIN or SIGTTOU was inherited with its default action, PrismTTY leaves a small caught handler after the session instead of changing a handler directly back to the default. That handler stops with SIGSTOP. Unlike the kernel default, it also stops an orphaned process group, a waiter sees SIGSTOP rather than the original signal, repeated deliveries can stop the process repeatedly, and SA_RESTART can change how an interrupted call returns. An in-process caller retains the caught action after cli::run returns, and a later fork inherits it until exec.

SIGUSR1 and SIGUSR2 sent to PrismTTY are passed to the command it started, alone, while it runs, unless PrismTTY inherited them ignored or blocked, and do not end PrismTTY themselves; like any signals of one kind they can coalesce. When PrismTTY records a signal that ends it, SIGUSR1 and SIGUSR2 sent after the record are no longer passed on, and each of PrismTTY's threads that takes one of them after that blocks both for itself (on macOS, and on Linux on x86-64 and ARM64), so a flood of them does not hold up that end; elsewhere they are not passed on after the record, but each one is still taken, so a flood of them can still hold up that end. When the command ends without such a signal, the two stay caught only until PrismTTY gives its signals back, when the caller's previous actions resume: until then a flood of them can delay the end, and after that one whose previous action is the default ends PrismTTY. A worker that handles SIGUSR1 while the command PrismTTY started ignores it gets nothing, and a shell that leaves SIGUSR1 at its default action dies from it and ends the session; to reach a server started through a shell, start it with exec, or send the signal to the server's own pid. A signal that PrismTTY inherited as ignored or blocked, as nohup leaves SIGHUP and a script's background job leaves SIGINT and SIGQUIT, is not passed on and does not end PrismTTY: PrismTTY leaves it as its caller set it, as before. This holds for SIGUSR1 and SIGUSR2 as for the signals that end it.

To page the output of a command that needs no keyboard, take the terminal off its stdin:

ptty show-report </dev/null | less -R

PrismTTY then leaves the terminal to the pager. Without </dev/null, PrismTTY and the pager both read the keyboard and both set the terminal's modes, and quitting the pager while the command still runs can leave the terminal in the pager's mode; stty sane puts it back.

On Linux 4.12+ the session normally ends once the wrapped command has exited and its output is drawn, even if a background job holds the terminal (its later output may not be shown); with an older kernel or no spare descriptors it waits for the terminal's end. A line discipline other than N_TTY can lose output.

Important options:

  • -p, --profile <name> forces one or more profiles.
  • --no-auto-detect uses only generic unless profiles are forced.
  • --no-dynamic-profile disables profile switching inside wrapped interactive shells.
  • -c, --config <file> loads a ChromaTerm-compatible YAML file.
  • --strip-ansi removes existing ANSI before PrismTTY styles output.
  • --sanitize strips window-title, clipboard (OSC 52), and other OSC/DCS string escapes from program output, as hardening against escape injection from untrusted remote devices. It assumes a terminal that really reads UTF-8 when the locale variables name UTF-8; PrismTTY infers that from their text and checks nothing. There an isolated invalid raw byte from 80 to 9F in ordinary text is kept as text, and a terminal that reads 8-bit bytes runs it as a C1 control, so --sanitize and --strip-ansi let raw C1 controls, an OSC 52 opened by 9D included, through to it. On a terminal --sanitize does not neutralize every incomplete control at the end of input, and it promises nothing about what another process writes to the same terminal. See SECURITY.md.
  • --show-profile prints profile selections and transitions to stderr. With auto-detection on, a selection that stays generic is not reported, so a session that never leaves generic prints nothing.
  • --local-echo locally echoes printable typed keys for no-echo device sessions.
  • --no-minimal-reset uses full SGR resets in interactive streams for terminal emulators that ignore minimal foreground/background resets. It can also be enabled with PRISMTTY_NO_MINIMAL_RESET=1 or PRISMTTY_NO_39_49_RESETS=1.
  • --trace-io <file> appends hex-encoded PTY input/output plus rendered-output diagnostics.
  • -R, --rgb forces RGB color output.
  • --pcre is accepted for ChromaTerm compatibility; PCRE2 is always used.
  • -b, --benchmark prints per-rule timing and match-count data.
  • -r, --reload asks running PrismTTY sessions to reload config.

Profile commands:

prismtty profiles list
prismtty profiles show cisco
prismtty profiles validate ~/.config/prismtty/profiles.d/my-vendor.yml
prismtty profiles test cisco fixtures/cisco.txt

Configuration

PrismTTY loads built-in profiles first, then user rules. By default it checks:

  • ~/.chromaterm.yml
  • ~/.chromaterm.yaml
  • ~/.config/chromaterm/chromaterm.yml
  • ~/.config/chromaterm/chromaterm.yaml
  • ~/.config/prismtty/config.yml
  • ~/.config/prismtty/config.yaml
  • /etc/chromaterm/chromaterm.yml
  • /etc/chromaterm/chromaterm.yaml
  • ~/.config/prismtty/profiles.d/*.yml
  • ~/.config/prismtty/profiles.d/*.yaml

ChromaTerm-style rules are supported directly:

rules:
  - description: IPv4
    regex: '\b192\.0\.2\.\d+\b'
    color: f#00ffff

Rules match bytes, not characters. A class like [äöü] is the set of bytes those letters are made of, so it also colors other letters that share one of those bytes, such as é, ß and ñ. To match characters, start the rule with (*UTF), as in regex: '(*UTF)[äöü]'. Since 1.3.12 such a rule keeps working past bytes in the output that are not valid UTF-8.

Native profile files add metadata:

profile:
  name: custom-router
  inherits: [generic]
  detection:
    - CustomOS
rules:
  - description: custom interface
    regex: '\bcust\d+/\d+\b'
    color: f#00ffff bold

Profiles under ~/.config/prismtty/profiles.d/ are first-class profiles: they appear in profiles list, can be shown with profiles show, can inherit built-in or other user profiles, and participate in auto-detection through their detection hints.

Built-in profiles are bundled data-driven profile files compiled into the binary. Their private runtime detection metadata is intentionally not part of the public user profile schema yet. If a user profile under profiles.d includes profile.runtime, profiles validate and normal startup loading reject it as a reserved field.

Reload

Long-running ptty /bin/zsh sessions register themselves in a small runtime directory, by default prismtty-<uid> in the system temporary directory. That is $TMPDIR when it is set, as it normally is on macOS, where it points to a per-user directory under /var/folders; on Linux without TMPDIR it is /tmp. Run this after editing ~/.chromaterm.yml or files under ~/.config/prismtty/:

prismtty --reload

The next output chunk in each running PrismTTY session reloads the active config. Only sessions watching the same runtime directory see the reload request. Set PRISMTTY_RUNTIME_DIR to override the runtime directory, which is useful for tests or isolated sessions. If the directory it names does not exist, PrismTTY creates missing parent directories with the permissions allowed by the process umask, then creates the final directory and sets it to mode 0700. An existing directory keeps its mode. A symbolic link, or a directory that your group or other users can write to, is refused, which only turns off live reload for that session. PrismTTY makes its own default directory private to you (mode 0700) before it is used. On macOS, an access control list (ACL) counts as well: an existing directory is also refused when an ACL entry lets someone other than its owner add or delete entries in it or change its owner or its permissions, or lets them write, delete, or change the times, the extended attributes, the owner or the permissions of the files created in it. PrismTTY removes the allow entries that its default directory, a directory it creates, or pids.d inherited before it creates files in them. Each session checks the runtime directory when it starts and keeps using that same directory while it still exists, even if the directory is renamed or replaced. If it is deleted while sessions run, for example by a program that cleans temporary files, a session detects the deletion on a later output chunk, not at once. While the location cannot be used, it retries at most once per second and live reload is unavailable. Once the session can check and use a directory created in the same location, later reload requests reach it again. A reload request that --reload wrote into the new directory before the session found it is normally taken when the session recovers. It can be missed because the session compares the request's time with a time it already recorded, either its own registration time or the time of the last request it acted on; a new directory on another file system, or a clock that was set back, can give the request an older time. Asking again after the session has recovered works as usual. On Linux, detection requires the removed open directory to report a link count of zero. A file system that keeps the count above zero is not covered. PrismTTY owns pids.d and reload in that directory: it creates pids.d if needed, makes it private to you, and deletes every regular file in it whose name is not the number of a running process. Do not point the variable at a directory that has a pids.d or a reload of your own. If your permissions do not let PrismTTY open one of these directories, live reload turns off and the warning names the directory.

The name prismtty-<uid> is easy to predict. In a temporary directory that other users can write to, such as /tmp on Linux without TMPDIR or a shared directory named by TMPDIR, another local user who creates that name first disables live reload for your sessions. Those sessions still show and highlight their output, and each prints prismtty: live reload disabled for this session and the reason. To avoid it, set PRISMTTY_RUNTIME_DIR to a private directory, such as one in your home, or set TMPDIR to a private one. Likewise, a tight open-file limit can turn off live reload for a session while the wrapped command still starts. The default temporary directory on macOS is a per-user one that only you can write to, also when TMPDIR is unset, so it is not affected.

Built-In Profiles

  • generic
  • juniper
  • cisco
  • arubacx
  • versa
  • arista
  • fortinet
  • palo-alto
  • linux-unix

These profiles are clean-room curated rule sets for prompts, interfaces, addresses, protocol states, syslog severity, operational status, counters, and common vendor terms.

The built-in rule sets and detection hints live as bundled profile data rather than hardcoded vendor branches. Adding or adjusting a built-in profile should start from the bundled profile file and its tests, while user profiles continue to use the public schema shown above. Bundled runtime metadata can also include private negative_signals that block only startup prompt matcher detection; weak detection hints, strong banner signals, and runtime prompt transitions are not blocked by those exclusions.

Interactive dynamic mode keeps built-in vendor selection conservative. After a specific profile such as generic, cisco or generic, juniper is selected, normal command output cannot add another vendor profile. Strong login banners can still switch profiles, and typed nested remote commands can switch after the next strong banner or repeated prompt.

Fortinet is intentionally more permissive from a local-shell baseline only. A single hostname # Fortinet prompt can promote to generic, fortinet, which supports local shell wrappers such as fw that show neither a FortiOS banner nor an explicit ssh command. Other prompt-only vendor switches still require repeated evidence or a typed remote-jump command.

When PrismTTY is launched as an iTerm profile command, it strips iTerm's native shell-integration variables from the child shell to avoid nested integration marks. The stripped values are preserved under PRISMTTY_PARENT_* names for dotfiles that need session or profile context. For example:

_iterm_session_id="${ITERM_SESSION_ID:-${PRISMTTY_PARENT_ITERM_SESSION_ID:-}}"

if [[ $_iterm_session_id =~ w[0-9]+t0p0 ]]; then
    fastfetch
fi

Feedback Wanted

Testing feedback is especially useful for the built-in profile coverage:

  • Cisco IOS, IOS XE, IOS XR, NX-OS, and ASA-style output
  • Juniper Junos
  • Fortinet FortiGate and FortiOS shells
  • Palo Alto PAN-OS
  • Arista EOS
  • Aruba CX
  • Versa
  • Linux and Unix administration output
  • Custom profile files for other vendors, appliances, and terminal workflows

Open an issue with the platform, the command, and a scrubbed snippet of the output.

Contributing

See CONTRIBUTING.md for development setup, the CLI module layout, fixture and privacy policy, and the pull request checklist.

Benchmark

Run the built-in throughput benchmark example:

cargo run --release --example throughput

The example runs router dump, syslog, and mixed-ANSI samples. Runtime benchmark mode is available in normal use:

prismtty --benchmark --profile cisco < show-tech.txt >/dev/null

Replay Fixtures

Replay fixtures under fixtures/replay/ are synthetic. They exist to protect profile detection and streaming coloring behavior across chunk boundaries without checking private device output into the repository.

Run the replay suite with:

cargo test --test replay

When adding a new replay case, use invented hostnames, documentation-range IP addresses, and minimal command output that preserves only the token shape needed for the rule under test. Do not copy real terminal captures into this directory.

License

MIT. See LICENSE.

About

Fast terminal output highlighter focused on network devices and Unix systems

Topics

Resources

Contributing

Security policy

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages