Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tomcur/termsnap
📸 Create SVGs from terminal output
https://github.com/tomcur/termsnap
ansi screenshot svg terminal vector-graphics
Last synced: 6 days ago
JSON representation
📸 Create SVGs from terminal output
- Host: GitHub
- URL: https://github.com/tomcur/termsnap
- Owner: tomcur
- License: apache-2.0
- Created: 2024-06-19T14:41:24.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-07-27T07:46:04.000Z (4 months ago)
- Last Synced: 2024-10-31T11:58:11.624Z (14 days ago)
- Topics: ansi, screenshot, svg, terminal, vector-graphics
- Language: Rust
- Homepage:
- Size: 159 KB
- Stars: 15
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# Termsnap 📸
**Create SVGs from terminal output**
![MIT/Apache 2.0](https://img.shields.io/badge/license-MIT%2FApache-blue.svg)
[![Crates.io](https://img.shields.io/crates/v/termsnap.svg)](https://crates.io/crates/termsnap)
[![Build status](https://github.com/tomcur/termsnap/workflows/CI/badge.svg)](https://github.com/tomcur/termsnap/actions)Termsnap turns terminal output into vector graphics. It uses an in-memory
instance of [Alacritty](https://github.com/alacritty/alacritty) under the hood
to be compatible with many terminal control sequences.## Usage
See `$ termsnap --help` for CLI usage documentation. For example, to run the
`ls` command and store the output in an SVG file, run:```bash
$ termsnap -- ls -l > ./out.svg
```## Examples
These examples are generated by [./scripts/examples.sh](scripts/examples.sh).
Note some of these examples send automated input to an interactive bash
session.### Cowsay
```bash
$ termsnap --lines 9 --columns 28 -- cowsay Hello, world
```![Termsnap output of the cowsay command saying "hello world"](./media/cow.svg)
### Neovim
```bash
# On exit, for some terminals, Neovim clears the terminal screen by swapping
# back to the main terminal screen buffer. The `--render-before-clear` argument
# renders the terminal screen as it was just prior to that swap occurring.
$ termsnap --lines 12 --columns 60 --term xterm-256color --render-before-clear -- nvim --clean ./scripts/example.py <