Giter Club home page Giter Club logo

termshot's Introduction

termshot License Go Report Card Build Codecov PkgGoDev Release

Terminal screenshot tool, which takes the console output and renders an output image that resembles a user interface window. The idea is similar to what carbon.now.sh, instaco.de, or codekeep.io/screenshot do. Instead of applying syntax highlight based on a programming language, termshot is using the ANSI escape codes of the program output. The result is clean screenshot (or recreation) of your terminal output. If you want, it has an option to edit the program output before creating the screenshot. This way you can remove unwanted sensitive content. Like time, watch, or perf, just place termshot before the command and you are set.

For example, termshot --show-cmd -- lolcat -f <(figlet -f big foobar) will create a screenshot which looks like this: example

Installation

macOS

Use homebrew to install termshot: brew install homeport/tap/termshot

Binaries

The releases section has pre-compiled binaries for Darwin, and Linux.

Notes

  • Since both termshot and your command can have command line flags, it is recommended to use -- to separate them.

    termshot --edit -- tool --apply --force
  • If you want to run a command and pipe the output into another, you have to use quotes to make this clear on the command line.

    termshot --show-cmd -- "figlet foobar | lolcat"
  • In order to work, termshot uses a pseudo terminal for the command to be executed. This means you can invoke a fully interactive shell and capture the entire output. The screenshot is created once you terminate the shell.

    termshot /bin/zsh
  • Please note: This project is work in progress. Although a lot of the ANSI sequences can be parsed, there are definitely commands in existence that create output that cannot be parsed correctly, yet. Also, commands that reset the cursor position are known to create issues.

termshot's People

Contributors

dependabot-preview[bot] avatar heavywombat avatar

Watchers

 avatar  avatar

Forkers

mungamibri77

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.