Termtosvg, a tool to record your terminal session

about termtosvg

In the next article we are going to take a look at termtosvg. This is a program that can get us out of trouble during a presentation, a course or a tutorial, in which we have to present the results of the commands executed in a terminal. When the public is present, it is possible to show the result immediately. But if they are not present at the time of execution, it is always interesting to have a recorded video showing the execution of the command. This can be done with a few tools, and among them is termtosvg. This program is a terminal recorder which presents the result as SVG animations.

Termstovg is a Unix terminal recorder written in Python which saves command line sessions as separate SVG files. When we have the file, we can use our web browser to reproduce the screenshot. In addition to all this, the tool has several themes available to record a terminal session that will allow us to use a specific color theme. We will be able to find the project in Github and has been developed by Nicolas Bedos.

This program is distributed with free BSD license. Termtosvg can remember tools like ascicinema, which is always a reference when making demos and tutorials.

General characteristics of Termtosvg

  • This program will produce lightweight, clean-looking animations to be embedded in a project page.
  • We will have the possibility to use custom color themes plus a terminal user interface and animation controls via SVG templates.
  • Es compatible with asciinema recording format.

Install termtosvg

We will be able to install this program through its universal package snap. Users of Ubuntu 16.04 and later, as well as other distros that have this format enabled, should be able to install it by opening a terminal (Ctrl + Alt + T) and typing into it:

termtosvg simosx installation package snap

sudo snap install termtosvg-simosx

In addition to the previous installation, we can install this program in Gnu / Linux, Mac OS and BSD operating systems, using Python> = 3.5. It can install using pip as they show us in their web page. We just have to open a terminal (Ctrl + Alt + T) and write in it:

pip3 install --user termtosvg

As indicated on the page of GitHub, this installation will need to cover some dependencies for a correct operation of the program.

Record a terminal session

Termtosvg recording

For this example I have installed the snap package option. Therefore, to start recording the command line session, all you have to do is run the following command in a terminal (Ctrl + Alt + T):

termtosvg-simosx.termtosvg animacion.svg

At the end of the recording, we will see that the route is indicated (generally / tmp) and the name of the recorded file. The result will be generated and saved automatically as an SVG file in our temporary directory (/ Tmp) if nothing is indicated. Although in the example we see in the previous screenshot, I have given the name to the capture animacion.svg. This will be saved in the current job file. After finishing the capture process, can be opened with Firefox or any other compatible program.

For end the burn process, just use the exit command in the terminal or press Ctrl + D.

Decorative appearance

We will be able to see templates and examples of termtosvg in your page If we want we can change the decorative look choosing the recording theme for the session (circus, classic-dark, classic-light, dracula, isotope, marrakesh, material, monokai, solarized-dark, solarized-light, zenburn). An example of use would be to write in the terminal (Ctrl + Alt + T):

termtosvg-simosx.termtosvg --theme circus

Or if we want change font type we will write:

termtosvg-simosx.termtosvg --font Fuente

In the previous order we will have to change Source by any of the fonts that we have installed on our computer.

While we record, we will be able to write the commands we want and work in the terminal. When we finish, you will only have to end the recording of the session by typing exit or by pressing Ctrl + D.

Termtosvg help

In addition, we will be able to find other help options for the program. To consult it, you just have to type in the terminal (Ctrl + Alt + T):

termtosvg simosx help

termtosvg-simosx.termtosvg --help

We can get more help in manual which we can find on their GitHub page.

Uninstall termtosvg

We will be able to eliminate the program in a way as simple as the one we use to install it. As for this example I have used the snap package, this is the uninstallation that we are going to see. In a terminal (Ctrl + Alt + T) we will only have to write the following command:

sudo snap remove termtosvg-simosx

Ultimately, this is a interesting and efficient tool in terms of consumption and size of the resulting files. It is also easy to use. This is an option to consider if you need to record your terminal sessions.


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.