Git Product home page Git Product logo

terminalizer's Introduction

Terminalizer

npm npm Gitter Unicorn Tweet

Record your terminal and generate animated gif images or share a web player link www.terminalizer.com

Built to be jusT cOol 👌🦄 !

If you think so, support me with a star and a follow 😘

Built while listening to Nyan Cat 😛



Special Thanks To:


Table of Contents

Features

  • Highly customizable.
  • Cross platform (Linux, Windows, MacOS).
  • Custom window frames.
  • Custom font.
  • Custom colors.
  • Custom styles with CSS.
  • Watermark.
  • Edit frames and adjust delays before rendering.
  • Skipping frames by a step value to reduce the number of rendered frames.
  • Render images with texts on them instead of capturing your screen for better quality.
  • The ability to configure:
    • The command to capture (bash, powershell.exe, yourOwnCommand, etc)
    • The current working directory.
    • Explicit values for the number of cols and rows.
    • GIF quality and repeating.
    • Frames delays.
    • The max idle time between frames.
    • Cursor style.
    • Font.
    • Font size.
    • Line height.
    • Letter spacing.
    • Theme.

What's Next

  • The Generate command to generate a web player for a recording file.
  • Support apt-get, yum, brew installation.

Installation

You need to install Node.js first, then install the tool globally using this command:

npm install -g terminalizer

Still facing an issue? Check the Issues section or open a new issue.

The installation should be very smooth with Node.js v4-v16. For newer versions, if the installation is failed, you may need to install the development tools to build the C++ add-ons. Check node-gyp.

Getting Started

Start recording your terminal using the record command.

terminalizer record demo

A file called demo.yml will be created in the current directory. You can open it using any editor to edit the configurations and the recorded frames. You can replay your recording using the play command.

terminalizer play demo

Now let's render our recording as an animated gif.

terminalizer render demo

Compression

GIF compression is not implemented yet. For now we recommend https://gifcompressor.com.

Usage

You can use the --help option to get more details about the commands and their options

terminalizer <command> [options]

Init

Create a global config directory

terminalizer init

Config

Generate a config file in the current directory

terminalizer config

Record

Record your terminal and create a recording file

terminalizer record <recordingFile>

Options

-c, --config        Overwrite the default configurations                                  [string]
-d, --command       The command to be executed                            [string] [default: null]
-k, --skip-sharing  Skip sharing and showing the sharing prompt message [boolean] [default: false]

Examples

terminalizer record foo                      Start recording and create a recording file called foo.yml
terminalizer record foo --config config.yml  Start recording with your own configurations

Play

Play a recording file on your terminal

terminalizer play <recordingFile>

Options

-r, --real-timing   Use the actual delays between frames as recorded        [boolean] [default: false]
-s, --speed-factor  Speed factor, multiply the frames delays by this factor [number] [default: 1]

Render

Render a recording file as an animated gif image

terminalizer render <recordingFile>

Options

-o, --output   A name for the output file                                      [string]
-q, --quality  The quality of the rendered image (1 - 100)                     [number]
-s, --step     To reduce the number of rendered frames (step > 1) [number] [default: 1]

Share

Upload a recording file and get a link for an online player

terminalizer share <recordingFile>

Generate

Generate a web player for a recording file

terminalizer generate <recordingFile>

Configurations

The default config.yml file is stored under the root directory of the project. Execute the below command to copy it to your current directory.

Use any editor to edit the copied config.yml, then use the -c option to override the default one.

terminalizer config

RECOMMENDED, use the init command to create a global config file to be used instead of the default one.

terminalizer init

For Linux and MacOS, the created directory is located under the home directory ~/config/terminalizer. For Windows, it is located under the AppData.

Recording

  • command: Specify a command to be executed like /bin/bash -l, ls, or any other command. The default is bash for Linux or powershell.exe for Windows.
  • cwd: Specify the current working directory path. The default is the current working directory path.
  • env: Export additional ENV variables, to be read by your scripts when starting the recording.
  • cols: Explicitly set the number of columns or use auto to take the current number of columns of your shell.
  • rows: Explicitly set the number of rows or use auto to take the current number of rows of your shell.

Delays

  • frameDelay: The delay between frames in ms. If the value is auto use the actual recording delays.
  • maxIdleTime: Maximum delay between frames in ms. Ignored if the frameDelay isn't set to auto. Set to auto to prevent limiting the max idle time.

GIF

  • quality: The quality of the generated GIF image (1 - 100).
  • repeat: Amount of times to repeat GIF:
    • If value is -1, play once.
    • If value is 0, loop indefinitely.
    • If value is a positive number, loop n times.

Terminal

  • cursorStyle: Cursor style can be one of block, underline, or bar.
  • fontFamily: You can use any font that is installed on your machine like Monaco or Lucida Console (CSS-like list).
  • fontSize: The size of the font in pixels.
  • lineHeight: The height of lines in pixels.
  • letterSpacing: The spacing between letters in pixels.

Theme

You can set the colors of your terminal using one of the CSS formats:

  • Hex: #FFFFFF.
  • RGB: rgb(255, 255, 255).
  • HSL: hsl(0, 0%, 100%).
  • Name: white, red, blue.

You can use the value transparent too.

The default colors that are assigned to the terminal colors are:

  • background: #ffffff transparent
  • foreground: #afafaf #afafaf
  • cursor: #c7c7c7 #c7c7c7
  • black: #232628 #232628
  • red: #fc4384 #fc4384
  • green: #b3e33b #b3e33b
  • yellow: #ffa727 #ffa727
  • blue: #75dff2 #75dff2
  • magenta: #ae89fe #ae89fe
  • cyan: #708387 #708387
  • white: #d5d5d0 #d5d5d0
  • brightBlack: #626566 #626566
  • brightRed: #ff7fac #ff7fac
  • brightGreen: #c8ed71 #c8ed71
  • brightYellow: #ebdf86 #ebdf86
  • brightBlue: #75dff2 #75dff2
  • brightMagenta: #ae89fe #ae89fe
  • brightCyan: #b1c6ca #b1c6ca
  • brightWhite: #f9f9f4 #f9f9f4

Watermark

You can add a watermark logo to your generated GIF images.

watermark:
  imagePath: AbsolutePathOrURL
  style:
    position: absolute
    right: 15px
    bottom: 15px
    width: 100px
    opacity: 0.9
  • watermark.imagePath: An absolute path for the image on your machine or a URL.
  • watermark.style: Apply CSS styles (camelCase) to the watermark image, like resizing it.

Frame Box

Terminalizer comes with predefined frames that you can use to make your GIF images look cool.

  • frameBox.type: Can be null, window, floating, or solid.
  • frameBox.title: To display a title for the frame or null.
  • frameBox.style: To apply custom CSS styles or to override the current ones.

Null Frame

No frame, just your recording.

Don't forget to add a backgroundColor under style.

frameBox:
  type: null
  title: null
  style:
    backgroundColor: black

Window Frame

frameBox:
  type: window
  title: Terminalizer
  style: []

Floating Frame

frameBox:
  type: floating
  title: Terminalizer
  style: []

Solid Frame

frameBox:
  type: solid
  title: Terminalizer
  style: []

Solid Frame Without Title

frameBox:
  type: solid
  title: null
  style: []

Styling Hint

You can disable the default shadows and margins.

frameBox:
  type: solid
  title: null
  style:
    boxShadow: none
    margin: 0px

FAQ

How to support ZSH

The default command that gets recorded for Linux is bash -l. You need to change the default command to zsh.

  • Generate a config file in the current directory
terminalizer config
  • Open the generated config file in your preferred editor.
  • Change the command to zsh:
command: zsh
  • You may need to change the font, check the font that is used in your terminal:
fontFamily: "Meslo for Powerline, Meslo LG M for Powerline"
  • Use the -c option to override the config file:
terminalizer record demo -c config.yml

Issues

error while loading shared libraries: libXss.so.1: cannot open shared object file: No such file or directory

Solution:

sudo yum install libXScrnSaver

error while loading shared libraries: libgconf-2.so.4: cannot open shared object file: No such file or directory

Solution:

sudo apt-get install libgconf-2-4

Error: EACCES: permission denied, access '/usr/local/lib'

Solution:

sudo mkdir -p /usr/local/lib/node_modules && sudo chown -R $(whoami):$(whoami) /usr/local/lib/node_modules

# then use the install command in the "Installation" section above
npm install -g terminalizer

License

This project is under the MIT license.

terminalizer's People

Contributors

adrienharnay avatar dependabot[bot] avatar dimisjim avatar faressoft avatar maricn avatar noplanman avatar simonepri avatar you-n-g avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

terminalizer's Issues

JavaScript heap out of memory

Running on Ubuntu 18, 8GB memory - although physical memory doesn't seem to get maxed out at any point I am getting:

<--- Last few GCs --->

[2916:0x19ce040]    92376 ms: Mark-sweep 1324.4 (1436.1) -> 1324.3 (1404.6) MB, 21.5 / 0.0 ms  (average mu = 0.363, current mu = 0.001) last resort GC in old space requested
[2916:0x19ce040]    92402 ms: Mark-sweep 1324.3 (1404.6) -> 1324.3 (1404.6) MB, 26.3 / 0.0 ms  (average mu = 0.196, current mu = 0.001) last resort GC in old space requested


<--- JS stacktrace --->

==== JS stack trace =========================================

    0: ExitFrame [pc: 0x39c0b3cd452b]
Security context: 0x0bf5ed3aede9 <JSObject>
    1: charCodeAt [0xbf5ed3b3b29](this=0x296a1984aee9 <Very long string[403780224]>,0)
    2: writeBlockMapping(aka writeBlockMapping) [0x365b3176eaf1] [/home/osboxes/bruteforce-helloworld/node_modules/js-yaml/lib/js-yaml/dumper.js:638] [bytecode=0xc3732cce109 offset=397](this=0x0dd8fbf825d9 <undefined>,state=0x2616779c4c19 <State map = 0x3615af1d50e1>,level...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: 0x7fbcca33b568 node::Abort() [/usr/lib/x86_64-linux-gnu/libnode.so.64]
 2: 0x7fbcca33b5b1  [/usr/lib/x86_64-linux-gnu/libnode.so.64]
 3: 0x7fbcca4fcd22 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/usr/lib/x86_64-linux-gnu/libnode.so.64]
 4: 0x7fbcca4fcf78 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/usr/lib/x86_64-linux-gnu/libnode.so.64]
 5: 0x7fbcca87e5f2  [/usr/lib/x86_64-linux-gnu/libnode.so.64]
 6: 0x7fbcca892197 v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [/usr/lib/x86_64-linux-gnu/libnode.so.64]
 7: 0x7fbcca860749 v8::internal::Factory::AllocateRawWithImmortalMap(int, v8::internal::PretenureFlag, v8::internal::Map*, v8::internal::AllocationAlignment) [/usr/lib/x86_64-linux-gnu/libnode.so.64]
 8: 0x7fbcca867b31 v8::internal::Factory::NewRawTwoByteString(int, v8::internal::PretenureFlag) [/usr/lib/x86_64-linux-gnu/libnode.so.64]
 9: 0x7fbcca992285 v8::internal::String::SlowFlatten(v8::internal::Handle<v8::internal::ConsString>, v8::internal::PretenureFlag) [/usr/lib/x86_64-linux-gnu/libnode.so.64]
10: 0x7fbccab1c472 v8::internal::Runtime_StringCharCodeAt(int, v8::internal::Object**, v8::internal::Isolate*) [/usr/lib/x86_64-linux-gnu/libnode.so.64]
11: 0x39c0b3cd452b 

After recording (Press CTRL+D, wait a few seconds, get this ^^)

Terminalizer should not automatically share recordings, or make it way more clear that it does.

Before using this, I read the entire readme. The impression I had afterwards was that I could share the recordings if I wanted to, since sharing is a separate command. I was annoyed to find out after using it the first time that I was incorrect in my understanding, and recordings are uploaded automatically. After re-reading the docs, it's still not clear from the readme that recordings will be automatically uploaded.

It appears things that are uploaded are not public by default, which is great. When I tried to create an account to confirm this, the site would not take my credentials, no matter how many times I reset them with different passwords. My initial test was nothing sensitive, but it was still something I did not want to upload anywhere.

With my limited experience, I like this product, especially because I can use it on Windows, Mac, and Linux, but that aspect really rubbed me the wrong way. I'll probably fork this and make a version that has no sharing functionality before I continue to test it further.

Add "terminal-recording" topic to this repo

As an educator, I'd like to be able to advertise the concept of creating animations from the terminal, without:

a) recommending a particular software,
b) collecting a bunch of individual links.

Thus, https://github.com/topics/terminal-recording is a perfect page to send learners to, to explore the topic further and find a tool that suits them.

How about terminalizer joins that small club and also uses the GitHup topic terminal-recording?

gif generated doesn't render special characters perfectly

terminalizer is a cool tool to record terminal and generate gif. 👍
I use it in my project to record a demonstration, and it works perfectly, record, and play, until render as an animated gif image.
I attached the gif generated at the end of readme doc, and a screenshot what it should be at the top.
Those parts are made up of these characters '▁', '▂', '▃', '▄', '▅', '▆', '▇', '█' (see origin).
Can this be fixed? 😁

PNG watermark issue?

I tried adding a watermark PNG. Got this:

events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: Stream not writable
    at module.exports.ChunkStream.write (/usr/local/lib/node_modules/terminalizer/node_modules/pngjs/lib/chunkstream.js:46:24)
    at exports.PNG.PNG.write (/usr/local/lib/node_modules/terminalizer/node_modules/pngjs/lib/png.js:93:16)
    at ReadStream.ondata (_stream_readable.js:639:20)
    at emitOne (events.js:116:13)
    at ReadStream.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11)
    at ReadStream.Readable.push (_stream_readable.js:208:10)
    at fs.read (fs.js:2051:12)
    at FSReqWrap.wrapper [as oncomplete] (fs.js:658:17)

I'm fairly sure I didn't screw up the path to the file, or any other obvious thing...

I'm on a Mac with Node v8.11.1.

Can't install

When I run the install command (with sudo), get this:

usr/local/bin/terminalizer -> /usr/local/lib/node_modules/terminalizer/bin/app.js

> [email protected] install /usr/local/lib/node_modules/terminalizer/node_modules/node-pty-prebuilt
> prebuild-install || node scripts/install.js

prebuild-install WARN install EACCES: permission denied, mkdir '/usr/local/lib/node_modules/terminalizer/node_modules/node-pty-prebuilt/build'
gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/terminalizer/node_modules/node-pty-prebuilt/build'
gyp ERR! System Linux 4.15.0-29-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/terminalizer/node_modules/node-pty-prebuilt
gyp ERR! node -v v8.9.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `prebuild-install || node scripts/install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/weyler/.npm/_logs/2018-07-29T00_58_39_796Z-debug.log

Any idea? I use Ubuntu 16.04, and my terminal have zsh, and I tried with all the readme's fixes but didn't work.

Send help.

Render fails on a server without a graphics card

I'm trying to render a recording, and after installing all the x11 dependencies, I hit this.
From reading, it appears this occurs when there is no graphics card (which is the case on this server).

$ terminalizer render certgen2.yml
Error:
  Error: libGL: OpenDriver: trying /usr/lib64/dri/tls/swrast_dri.so
libGL: OpenDriver: trying /usr/lib64/dri/swrast_dri.so

Ideally I'd like to be able to render inside a Docker container - are there any plans to render with fewer dependencies?

Can't Install in Ubuntu

I don't know what's the issue. I'll paste the err after run 'sudo npm i -g terminalizer'
Node version: v10.9.0
npm version: 6.4.0

`/usr/local/bin/terminalizer -> /usr/local/lib/node_modules/terminalizer/bin/app.js

[email protected] install /usr/local/lib/node_modules/terminalizer/node_modules/node-pty-prebuilt
prebuild-install || node scripts/install.js

prebuild-install WARN install EACCES: permission denied, access '/home/cristoamh/.npm'
gyp WARN EACCES user "root" does not have permission to access the dev dir "/home/cristoamh/.node-gyp/10.9.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/terminalizer/node_modules/node-pty-prebuilt/.node-gyp"
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/terminalizer/node_modules/node-pty-prebuilt/.node-gyp'
gyp ERR! System Linux 4.18.5-041805-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--build_v8_with_gn=false"
gyp ERR! cwd /usr/local/lib/node_modules/terminalizer/node_modules/node-pty-prebuilt
gyp ERR! node -v v10.9.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: prebuild-install || node scripts/install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/cristoamh/.npm/_logs/2018-08-24T21_36_07_802Z-debug.log
`

Can't install since Python is too new

When I attempt to install on macOS 10.13.6, it fails because my version of Python is too new.

$ python -V
Python 3.7.0

This version of Python was previously installed using Homebrew.

$ npm i -g terminalizer
/usr/local/bin/terminalizer -> /usr/local/lib/node_modules/terminalizer/bin/app.js

> [email protected] install /usr/local/lib/node_modules/terminalizer/node_modules/node-pty-prebuilt
> prebuild-install || node scripts/install.js

prebuild-install WARN install No prebuilt binaries found (target=10.1.0 runtime=node arch=x64 platform=darwin)
gyp ERR! configure error
gyp ERR! stack Error: Python executable "/usr/local/bin/python" is v3.7.0, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
gyp ERR! stack     at PythonFinder.failPythonVersion (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:492:19)
gyp ERR! stack     at PythonFinder.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:474:14)
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:273:7)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at maybeClose (internal/child_process.js:957:16)
gyp ERR! stack     at Socket.stream.socket.on (internal/child_process.js:378:11)
gyp ERR! stack     at Socket.emit (events.js:182:13)
gyp ERR! stack     at Pipe._handle.close [as _onclose] (net.js:598:12)
gyp ERR! System Darwin 17.7.0
gyp ERR! command "/usr/local/Cellar/node/10.1.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/terminalizer/node_modules/node-pty-prebuilt
gyp ERR! node -v v10.1.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `prebuild-install || node scripts/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/neil/.npm/_logs/2018-08-03T08_03_27_250Z-debug.log

The solution was to temporarily unlink the Homebrew version of Python (brew unlink python) to revert back to the system-installed version (Python 2.7.10), install terminalizer, and then relink Python 3.

Reporting this as there's no mention of Python version requirements in the README.

render webp format output

Thanks for your great jobs, it's really cool!

For now, default shadows and margins is not transparent which not look pretty

As we know, gif format do not perform good when alpha channel exists, because gif's alpha is 0 or 1. it cannot be 0.6

If we use gif and transparent margins, we cannot Eliminating jagged edges.

That's why I suggest to add a webp format output option. It's popular, thinner than gif, and perform good with alpha channel. Then we can transparent margins.

is this thing working?

I got this after installing terminalizer with npm install -g terminalizer:

$ terminalizer 
/usr/local/lib/node_modules/terminalizer/node_modules/yargs/lib/command.js:22
    globalMiddleware.push(...middlewares)
                          ^^^

SyntaxError: Unexpected token ...
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:374:25)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/terminalizer/node_modules/yargs/lib/argsert.js:2:17)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)

um, help ?

Can't install on mac

When trying to install it throws permission error. Even when tried installing by becoming root then also getting error of the following form:-
gyp WARN EACCES user "root" does not have permission to access the dev dir "/usr/local/lib/node_modules/terminalizer/node_modules/node-pty-prebuilt/.node-gyp/8.11.4" gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/terminalizer/node_modules/node-pty-prebuilt/.node-gyp"

Support for Fish shell

I installed terminalizer using npm install -g terminalizer but it doesn't work using Fish shell. It doesn't recognize the command so I guess somehow it's not being added to the path.
Here is the output:

 !  ~/ npm install -g terminalizer                                                                                                                                                                                                                                                       13.2s  Tue Jul 31 09:56:50 2018
/usr/local/Cellar/node/9.2.1/bin/terminalizer -> /usr/local/Cellar/node/9.2.1/lib/node_modules/terminalizer/bin/app.js

> [email protected] install /usr/local/Cellar/node/9.2.1/lib/node_modules/terminalizer/node_modules/node-pty-prebuilt
> prebuild-install || node scripts/install.js


> [email protected] postinstall /usr/local/Cellar/node/9.2.1/lib/node_modules/terminalizer/node_modules/electron
> node install.js

Downloading SHASUMS256.txt
[============================================>] 100.0% of 5.33 kB (5.33 kB/s)

> [email protected] postinstall /usr/local/Cellar/node/9.2.1/lib/node_modules/terminalizer/node_modules/node-pty-prebuilt
> node scripts/post-install.js

+ [email protected]
added 266 packages in 210.878s
 ~/  terminalizer                                                                                                                                                                                                                                                                           3.5m  Tue Jul 31 10:00:23 2018
fish: Unknown command 'terminalizer'

Thank you so much in advance. Great job you all. This looks like such an amazing tool!

suggestion: zsh autocompletes

Just thinking about a zsh autocomplete script so I can tab through the command, might give it a go and send a PR later on

Non-global per project dependency doesn't work with "render"

First, thanks for such an awesome library!

npm install -g terminalizer, then terminalizer render some-recording works as expected.

But if you do npm install terminalizer, then npx terminalizer render some-recording it hangs indefinitely without any output.

It would be cool if terminalizer also worked from the project's node_modules so it doesn't have to be installed globally.

Cannot render on Linux because of "gtk theme"

Hello,

When trying to render on Ubuntu Linux 4.17.11-041711-generic I get the following error :

Theme parsing error: gtk.css:6777:29: Missing opening bracket in color definition

Here is a demo of the issue : https://asciinema.org/a/nrVz5y3NxIXMDL99Y7NrNh90q

I don't really understand how this error makes it impossible for the app to work as I run many other Electron apps on my desktop and have never had such a problem (where the app will simply die for no apparent reason)

The theme file isn't even mine, pretty sure it is a standard theme that came with Ubuntu.

Render hangs if watermark image path is wrong

Hello,

I noticed that; if the watermark image url path is wrong, render command is just hanging. I think some error message would be great because I had to search source of problem very long time.

And thank you for this great tool.

[Edit]
Versions:

> node --version
v10.15.0
> terminalizer --version
0.6.0

No token & errors in generating share

~$ terminalizer share test
Please enter some details about your recording
? Title Test
? Description Testing terminalizer
? Tags such as git,bash,game linux

/usr/local/lib/node_modules/terminalizer/commands/share.js:194
return reject(body.errors.join('\n'));
^

TypeError: Cannot read property 'join' of undefined
at Request._callback (/usr/local/lib/node_modules/terminalizer/commands/share.js:194:35)
at Request.self.callback (/usr/local/lib/node_modules/terminalizer/node_modules/request/request.js:185:22)
at emitTwo (events.js:126:13)
at Request.emit (events.js:214:7)
at Request. (/usr/local/lib/node_modules/terminalizer/node_modules/request/request.js:1161:10)
at emitOne (events.js:116:13)
at Request.emit (events.js:211:7)
at IncomingMessage. (/usr/local/lib/node_modules/terminalizer/node_modules/request/request.js:1083:12)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:111:20)

Required to forcefully kill program after recording demo

I just recorded my first demo with terminalizer record demo and ended it with Ctrl-D. However, after that it shows the following message:

Open the following link in your browser and login into your account
https://terminalizer.com/token?token=xxx

When you do it, press any key to continue
Enjoy !

I pressed enter to skip it because I have no desire to create an account, but it seems to keep coming back and Ctrl-C doesn't exit out of it. I had to use kill -9 <pid> to exit the program. Is there a global option to disable this "feature"?

Sign up - Error

When attempting to simply sign up as new user after filling out the form returns 500.
Screen Shot 2019-03-14 at 3 50 05 PM

Add zsh support

With zsh it works, but missing my config and gives a warning.

➜  ~ terminalizer record test
The recording session is started
Press CTRL+D to exit and save the recording
bash: /Users/pltvs/.bashrc: No such file or directory
Aliaksandrs-MacBook-Pro:~ pltvs$

Does watermark work?

Here's my test:

timsehn:quick-test timsehn$ cat test.yml 
# The configurations that used for the recording, feel free to edit them
config:

  # Specify a command to be executed
  # like `/bin/bash -l`, `ls`, or any other commands
  # the default is bash for Linux
  # or powershell.exe for Windows
  command: bash -l
  
  # Specify the current working directory path
  # the default is the current working directory path
  cwd: /Users/timsehn/liquidata/terminalizer-videos/quick-test
  
  # Export additional ENV variables
  env:
    recording: true
  
  # Explicitly set the number of columns
  # or use `auto` to take the current
  # number of columns of your shell
  cols: 88
  
  # Explicitly set the number of rows
  # or use `auto` to take the current
  # number of rows of your shell
  rows: 44
  
  # Amount of times to repeat GIF
  # If value is -1, play once
  # If value is 0, loop indefinitely
  # If value is a positive number, loop n times
  repeat: 0
  
  # Quality
  # 1 - 100
  quality: 100
  
  # Delay between frames in ms
  # If the value is `auto` use the actual recording delays
  frameDelay: auto
  
  # Maximum delay between frames in ms
  # Ignored if the `frameDelay` isn't set to `auto`
  # Set to `auto` to prevent limiting the max idle time
  maxIdleTime: 2000
  
  # The surrounding frame box
  # The `type` can be null, window, floating, or solid`
  # To hide the title use the value null
  # Don't forget to add a backgroundColor style with a null as type
  frameBox:
    type: floating
    title: Terminalizer
    style:
      border: 0px black solid
      boxShadow: none
      # margin: 0px
  
  # Add a watermark image to the rendered gif
  # You need to specify an absolute path for
  # the image on your machine or a URL, and you can also
  # add your own CSS styles
  watermark:
    imagePath: /Users/timsehn/liquidata/git/logo/dolt/Dolt.png
    style:
      position: absolute
      right: 15px
      top: 15px
      height: 50px
      width: 50px
  
  # Cursor style can be one of
  # `block`, `underline`, or `bar`
  cursorStyle: block
  
  # Font family
  # You can use any font that is installed on your machine
  # in CSS-like syntax
  fontFamily: "Monaco, Lucida Console, Ubuntu Mono, Monospace"
  
  # The size of the font
  fontSize: 12
  
  # The height of lines
  lineHeight: 1
  
  # The spacing between letters
  letterSpacing: 0
  
  # Theme
  theme:
    background: "transparent"
    foreground: "#afafaf"
    cursor: "#c7c7c7"
    black: "#232628"
    red: "#fc4384"
    green: "#b3e33b"
    yellow: "#ffa727"
    blue: "#75dff2"
    magenta: "#ae89fe"
    cyan: "#708387"
    white: "#d5d5d0"
    brightBlack: "#626566"
    brightRed: "#ff7fac"
    brightGreen: "#c8ed71"
    brightYellow: "#ebdf86"
    brightBlue: "#75dff2"
    brightMagenta: "#ae89fe"
    brightCyan: "#b1c6ca"
    brightWhite: "#f9f9f4"
  
# Records, feel free to edit them
records:
  - delay: 1056
    content: "Restored session: Fri Mar  1 14:15:33 PST 2019\r\n"
  - delay: 13
    content: "\e]7;file://timsehn.hopto.org/Users/timsehn/liquidata/terminalizer-videos/quick-test\a\e[?1034htimsehn:quick-test timsehn$ "
  - delay: 1391
    content: l
  - delay: 101
    content: s
  - delay: 135
    content: ' '
  - delay: 191
    content: '-'
  - delay: 428
    content: a
  - delay: 270
    content: l
  - delay: 697
    content: "\r\n"
  - delay: 6
    content: "total 0\r\ndrwxr-xr-x  2 timsehn  staff   64 Mar  1 14:48 .\r\ndrwxr-xr-x  6 timsehn  staff  192 Mar  1 14:48 ..\r\n\e]7;file://timsehn.hopto.org/Users/timsehn/liquidata/terminalizer-videos/quick-test\atimsehn:quick-test timsehn$ "
  - delay: 2172
    content: "logout\r\nSaving session..."
  - delay: 11
    content: "\r\n...saving history..."
  - delay: 11
    content: "truncating history files...\r\n...completed.\r\n"

I can change the image to any image on the web such as:

https://www.liquidata.co/Liquidata-main-logo-RGB.png

I also messed around with the CSS properties. Can't get it to work.

I tried poking around in the code to see if I could figure out my error but alas, my javascript is weak. The last render is attached.

render1551483793993

Terminalizer doesn't respect cwd config key

Terminalizer 0.6.0 seems to ignore the cwd in a recording configuration. That is, even when I change the key from the default, my shell still starts in the same directory that I start Terminalizer in. Currently, I've worked around this issue by using a pwd key. I believe the workaround succeeds because of a typo in commands/record.js where cwd is misspelled as pwd, leading to the pwd key being used to set the working directory.

  // PTY instance
  var ptyProcess = di.pty.spawn(command, commandArguments, {
    cols: config.json.cols,
    rows: config.json.rows,
    cwd: config.json.pwd, /** Typo here **/
    env: di.deepmerge(process.env, config.json.env)
  });

This typo, as of now, also exists on master.

Render Gets Stuck on 24%

I'm running into an issue where terminalizer render file_name stops rendering at 39 frames (24%):

Rendering frame 39/159 24% [=======-----------------------] 14.4s^C
me@local:$  
me@local:$ terminalizer render high_baller_intro
Rendering frame 39/159 24% [=======-----------------------] 12.0s^C
me@local:$  
me@local:$ terminalizer render high_baller_intro
Rendering frame 39/159 24% [=======-----------------------] 11.8s
me@local:$  
me@local:$ terminalizer render high_baller_intro.yml 
Rendering frame 39/159 24% [=======-----------------------] 12.1s^C
me@local:$  
me@local:$ terminalizer render high_baller_intro.yml 
Rendering frame 39/159 24% [=======-----------------------] 11.8s^C
me@local:$

I've checked a few other issues here on Github and I can't seem to find a common cause. Here's my .yml file:

# The configurations that used for the recording, feel free to edit them
config:

  # Specify a command to be executed
  # like `/bin/bash -l`, `ls`, or any other commands
  # the default is bash for Linux
  # or powershell.exe for Windows
  command: bash -l
  
  # Specify the current working directory path
  # the default is the current working directory path
  cwd: /Users/john/aion_web3
  
  # Export additional ENV variables
  env:
    recording: true
  
  # Explicitly set the number of columns
  # or use `auto` to take the current
  # number of columns of your shell
  cols: 80
  
  # Explicitly set the number of rows
  # or use `auto` to take the current
  # number of rows of your shell
  rows: 24
  
  # Amount of times to repeat GIF
  # If value is -1, play once
  # If value is 0, loop indefinitely
  # If value is a positive number, loop n times
  repeat: 0
  
  # Quality
  # 1 - 100
  quality: 100
  
  # Delay between frames in ms
  # If the value is `auto` use the actual recording delays
  frameDelay: auto
  
  # Maximum delay between frames in ms
  # Ignored if the `frameDelay` isn't set to `auto`
  # Set to `auto` to prevent limiting the max idle time
  maxIdleTime: 2000
  
  # The surrounding frame box
  # The `type` can be null, window, floating, or solid`
  # To hide the title use the value null
  # Don't forget to add a backgroundColor style with a null as type
  frameBox:
    type: floating
    title: Terminalizer
    style:
      border: 0px black solid
      # boxShadow: none
      # margin: 0px
  
  # Add a watermark image to the rendered gif
  # You need to specify an absolute path for
  # the image on your machine or a URL, and you can also
  # add your own CSS styles
  watermark:
    imagePath: null
    style:
      position: absolute
      right: 15px
      bottom: 15px
      width: 100px
      opacity: 0.9
  
  # Cursor style can be one of
  # `block`, `underline`, or `bar`
  cursorStyle: block
  
  # Font family
  # You can use any font that is installed on your machine
  # in CSS-like syntax
  fontFamily: "Monaco, Lucida Console, Ubuntu Mono, Monospace"
  
  # The size of the font
  fontSize: 12
  
  # The height of lines
  lineHeight: 1
  
  # The spacing between letters
  letterSpacing: 0
  
  # Theme
  theme:
    background: "transparent"
    foreground: "#afafaf"
    cursor: "#c7c7c7"
    black: "#232628"
    red: "#fc4384"
    green: "#b3e33b"
    yellow: "#ffa727"
    blue: "#75dff2"
    magenta: "#ae89fe"
    cyan: "#708387"
    white: "#d5d5d0"
    brightBlack: "#626566"
    brightRed: "#ff7fac"
    brightGreen: "#c8ed71"
    brightYellow: "#ebdf86"
    brightBlue: "#75dff2"
    brightMagenta: "#ae89fe"
    brightCyan: "#b1c6ca"
    brightWhite: "#f9f9f4"
  
# Records, feel free to edit them
records:
  - delay: 1000
    content: 'n'
  - delay: 50
    content: o
  - delay: 50
    content: d
  - delay: 50
    content: e
  - delay: 50
    content: ' '
  - delay: 50
    content: c
  - delay: 50
    content: o
  - delay: 50
    content: 'n'
  - delay: 50
    content: s
  - delay: 50
    content: o
  - delay: 50
    content: l
  - delay: 50
    content: e
  - delay: 50
    content: .
  - delay: 50
    content: j
  - delay: 50
    content: s
  - delay: 50
    content: "\r\n"
  - delay: 100
    content: "Connected to default https://aion-web3-api.example.com\r\n\r\n"
  - delay: 100
    content: "aion-web3-api.example.com> "
  - delay: 1000
    content: c
  - delay: 50
    content: o
  - delay: 50
    content: 'n'
  - delay: 50
    content: s
  - delay: 50
    content: t
  - delay: 50
    content: ' '
  - delay: 50
    content: h
  - delay: 50
    content: i
  - delay: 50
    content: g
  - delay: 50
    content: h
  - delay: 50
    content: _
  - delay: 50
    content: b
  - delay: 50
    content: a
  - delay: 50
    content: l
  - delay: 50
    content: l
  - delay: 50
    content: e
  - delay: 50
    content: r
  - delay: 50
    content: ' '
  - delay: 50
    content: '='
  - delay: 50
    content: ' '
  - delay: 50
    content: "0x..."
  - delay: 50
    content: ''
  - delay: 50
    content: "\r\n\r\n"
  - delay: 100
    content: "[undefined]\r\n\r\n"
  - delay: 100
    content: "aion-web3-api.example.com> "
  - delay: 1000
    content: w
  - delay: 50
    content: e
  - delay: 50
    content: b
  - delay: 50
    content: '3'
  - delay: 50
    content: .
  - delay: 50
    content: e
  - delay: 50
    content: t
  - delay: 50
    content: h
  - delay: 50
    content: .
  - delay: 50
    content: g
  - delay: 50
    content: e
  - delay: 50
    content: t
  - delay: 50
    content: B
  - delay: 50
    content: a
  - delay: 50
    content: l
  - delay: 50
    content: a
  - delay: 50
    content: 'n'
  - delay: 50
    content: c
  - delay: 50
    content: "e"
  - delay: 50
    content: '('
  - delay: 50
    content: 'h'
  - delay: 50
    content: i
  - delay: 50
    content: g
  - delay: 50
    content: h
  - delay: 50
    content: _
  - delay: 50
    content: b
  - delay: 50
    content: a
  - delay: 50
    content: l
  - delay: 50
    content: l
  - delay: 50
    content: e
  - delay: 50
    content: r
  - delay: 50
    content: ','
  - delay: 50
    content: ' '
  - delay: 50
    content: "("
  - delay: 50
    content: e
  - delay: 50
    content: r
  - delay: 50
    content: r
  - delay: 50
    content: ','
  - delay: 50
    content: ' '
  - delay: 50
    content: b
  - delay: 50
    content: a
  - delay: 50
    content: l
  - delay: 50
    content: )
  - delay: 50
    content: ' '
  - delay: 50
    content: =
  - delay: 50
    content: '>'
  - delay: 50
    content: ' '
  - delay: 50
    content: '{'
  - delay: 50
    content: b
  - delay: 50
    content: a
  - delay: 50
    content: l
  - delay: 50
    content: a
  - delay: 50
    content: 'n'
  - delay: 50
    content: c
  - delay: 50
    content: e
  - delay: 50
    content: ' '
  - delay: 50
    content: =
  - delay: 50
    content: ' '
  - delay: 50
    content: b
  - delay: 50
    content: a
  - delay: 50
    content: l
  - delay: 50
    content: '}'
  - delay: 50
    content: )
  - delay: 50
    content: "\r\r\n"
  - delay: 100
    content: "Promise {\r\n  \e[36m<pending>\e[39m,\r\n  domain:\r\n   Domain {\r\n     domain: \e[1mnull\e[22m,\r\n     _events:\r\n      [Object: null prototype] {\r\n        removeListener: \e[36m[Function: updateExceptionCapture]\e[39m,\r\n        newListener: \e[36m[Function: updateExceptionCapture]\e[39m,\r\n        error: \e[36m[Function: debugDomainError]\e[39m },\r\n     _eventsCount: \e[33m3\e[39m,\r\n     _maxListeners: \e[90mundefined\e[39m,\r\n     members: [] } }\r\n"
  - delay: 100
    content: "https://aion-web3-api.example.com> "
  - delay: 1000
    content: b
  - delay: 50
    content: a
  - delay: 50
    content: l
  - delay: 50
    content: a
  - delay: 50
    content: 'n'
  - delay: 50
    content: c
  - delay: 50
    content: e
  - delay: 50
    content: "\r\n44893545833580441025"
  - delay: 50
    content: "\r\nhttps://aion-web3-api.example.com> "
  - delay: 1000
    content: w
  - delay: 50
    content: e
  - delay: 50
    content: b
  - delay: 50
    content: '3'
  - delay: 50
    content: .
  - delay: 50
    content: u
  - delay: 50
    content: t
  - delay: 50
    content: i
  - delay: 50
    content: l
  - delay: 50
    content: s
  - delay: 50
    content: .
  - delay: 50
    content: f
  - delay: 50
    content: r
  - delay: 50
    content: o
  - delay: 50
    content: m
  - delay: 50
    content: 'N'
  - delay: 50
    content: A
  - delay: 50
    content: m
  - delay: 50
    content: p
  - delay: 50
    content: (
  - delay: 50
    content: b
  - delay: 50
    content: a
  - delay: 50
    content: l
  - delay: 50
    content: a
  - delay: 50
    content: 'n'
  - delay: 50
    content: c
  - delay: 50
    content: e
  - delay: 50
    content: ','
  - delay: 50
    content: ' '
  - delay: 50
    content: ''''
  - delay: 50
    content: a
  - delay: 50
    content: i
  - delay: 50
    content: o
  - delay: 50
    content: 'n'
  - delay: 50
    content: ''''
  - delay: 50
    content: )
  - delay: 100
    content: "\r\r\n\e[32m'44.893545833580441025'\r\n"
  - delay: 50
    content: "https://aion-web3-api.example.com> "
  - delay: 952
    content: "logout\r\nSaving session..."
  - delay: 11
    content: "\r\n...saving history..."
  - delay: 6
    content: "truncating history files...\r\n...completed.\r\n"

Running V0.4.1 on macOS Mojave (10.14 [18A391]) installed via Brew.

Support for ANSI escape codes?

I use ANSI escape codes in my prompt:

$ echo $PS1
\[\033[7m\][\u - \w]\[\033[0m\] $

This creates a prompt with reverse video.

When I record a session using terminalizer, the prompt is captured like this:

content: "\e[7m[cjohnson - ~/proj/docker1]\e[0m $ "

And when I render this, it comes through as a solid block of white (characters not visible).

Can you suggest how to capture and render this -- special considerations for ANSI codes?

render quits without any output or generated files

Hi,

When I run $ terminalizer render demo the program exits (exit code 0) without printing any output to the terminal or creating a gif file.

I am running using wsl (bash on ubuntu on windows).
When I run the same command using the same demo.yml file in powershell it works so I guess this is some problem due to either linux in general or more likely wsl.

node v10.15.0
terminalizer v0.6.0

Render on small recording taking over 30 minutes

I have a small 200 line recording (included at the bottom) where I was testing terminalizer which was recorded using this command:

terminalizer record ./src/static/some-recording.yml --config terminalizerrc.yml

I am using the following command to render it to a gif:

terminalizer render ./src/static/some-recording.yml --output ./src/static/some-recording.gif

image

I'm on version 0.2.11, installed with npm install -g terminalizer

image

I'm on a mac, latest stable version.

I finally killed the process after 30 minutes. Any idea why it would be taking so long?


some-recording.yml

# The configurations that used for the recording, feel free to edit them
config:

  # Specify a command to be executed
  # like `/bin/bash -l`, `ls`, or any other commands
  # the default is bash for Linux
  # or powershell.exe for Windows
  command: bash -l
  
  # Specify the current working directory path
  # the default is the current working directory path
  cwd: /Users/trevordmiller/repos/slides-starter
  
  # Export additional ENV variables
  env:
    recording: true
  
  # Explicitly set the number of columns
  # or use `auto` to take the current
  # number of columns of your shell
  cols: 280
  
  # Explicitly set the number of rows
  # or use `auto` to take the current
  # number of rows of your shell
  rows: 71
  
  # Amount of times to repeat GIF
  # If value is -1, play once
  # If value is 0, loop indefinitely
  # If value is a positive number, loop n times
  repeat: -1
  
  # Quality
  # 1 - 100
  quality: 100
  
  # Delay between frames in ms
  # If the value is `auto` use the actual recording delays
  frameDelay: auto
  
  # Maximum delay between frames in ms
  # Ignored if the `frameDelay` isn't set to `auto`
  # Set to `auto` to prevent limiting the max idle time
  maxIdleTime: 2000
  
  # The surrounding frame box
  # The `type` can be null, window, floating, or solid`
  # To hide the title use the value null
  # Don't forget to add a backgroundColor style with a null as type
  frameBox:
    type: null
    title: null
    style:
      backgroundColor: black
  
  # Add a watermark image to the rendered gif
  # You need to specify an absolute path for
  # the image on your machine or a URL, and you can also
  # add your own CSS styles
  watermark:
    imagePath: null
    style:
      position: absolute
      right: 15px
      bottom: 15px
      width: 100px
      opacity: 0.9
  
  # Cursor style can be one of
  # `block`, `underline`, or `bar`
  cursorStyle: block
  
  # Font family
  # You can use any font that is installed on your machine
  # in CSS-like syntax
  fontFamily: "monospace"
  
  # The size of the font
  fontSize: 32
  
  # The height of lines
  lineHeight: 1
  
  # The spacing between letters
  letterSpacing: 0
  
  # Theme
  theme:
    background: "transparent"
    foreground: "#C5D4DD"
    cursor: "#7FC1CA"
    black: "#3C4C55"
    red: "#DF8C8C"
    green: "#A8CE93"
    yellow: "#DADA93"
    blue: "#83AFE5"
    magenta: "#9A93E1"
    cyan: "#7FC1CA"
    white: "#C5D4DD"
    brightBlack: "#899BA6"
    brightRed: "#F2C38F"
    brightGreen: "#A8CE93"
    brightYellow: "#DADA93"
    brightBlue: "#83AFE5"
    brightMagenta: "#D18EC2"
    brightCyan: "#7FC1CA"
    brightWhite: "#E6EEF3"
  
# Records, feel free to edit them
records:
  - delay: 904
    content: "\r\r\n\e[01;36mslides-starter\r\r\n\e[01;33m$\e[0m "
  - delay: 3585
    content: e
  - delay: 158
    content: c
  - delay: 66
    content: h
  - delay: 81
    content: o
  - delay: 146
    content: ' '
  - delay: 225
    content: '"'
  - delay: 562
    content: S
  - delay: 135
    content: o
  - delay: 56
    content: m
  - delay: 124
    content: e
  - delay: 90
    content: ' '
  - delay: 79
    content: e
  - delay: 158
    content: x
  - delay: 33
    content: a
  - delay: 89
    content: m
  - delay: 48
    content: p
  - delay: 54
    content: l
  - delay: 192
    content: e
  - delay: 461
    content: ' '
  - delay: 79
    content: r
  - delay: 56
    content: e
  - delay: 158
    content: c
  - delay: 315
    content: o
  - delay: 123
    content: r
  - delay: 66
    content: d
  - delay: 103
    content: i
  - delay: 45
    content: 'n'
  - delay: 79
    content: g
  - delay: 169
    content: '"'
  - delay: 427
    content: "\r\nSome example recording\r\n\r\r\n\e[01;36mslides-starter\r\r\n\e[01;33m$\e[0m "
  - delay: 10305
    content: g
  - delay: 71
    content: i
  - delay: 131
    content: t
  - delay: 90
    content: ' '
  - delay: 157
    content: s
  - delay: 56
    content: t
  - delay: 68
    content: a
  - delay: 56
    content: t
  - delay: 102
    content: u
  - delay: 90
    content: s
  - delay: 551
    content: "\r\n"
  - delay: 17
    content: "\e[1;30m\e[m\e[1;30mOn branch \e[m\e[36mmaster\e[m\r\n\e[1;30mYour branch is up to date with 'origin/master'.\e[m\r\n\r\n\e[1;30mChanges to be committed:\e[m\r\n\e[1;30m  (use \"git reset HEAD <file>...\" to unstage)\e[m\r\n\e[1;30m\e[m\r\n\e[1;30m\t\e[m\e[32mmodified:   .lintstagedrc.json\e[m\r\n\e[1;30m\t\e[m\e[32mmodified:   contributing.md\e[m\r\n\e[1;30m\t\e[m\e[32mmodified:   package.json\e[m\r\n\e[1;30m\t\e[m\e[32mmodified:   src/index.mdx\e[m\r\n\e[1;30m\t\e[m\e[32mdeleted:    src/static/some-image.gif\e[m\r\n\e[1;30m\t\e[m\e[32mnew file:   terminalizerrc.yml\e[m\r\n\e[1;30m\e[m\r\n\e[1;30mUntracked files:\e[m\r\n\e[1;30m  (use \"git add <file>...\" to include in what will be committed)\e[m\r\n\e[1;30m\e[m\r\n\e[1;30m\t\e[36msrc/static/\e[m\r\n\r\n\r\r\n\e[01;36mslides-starter\r\r\n\e[01;33m$\e[0m "
  - delay: 7733
    content: "logout\r\n"

terminalizerrc.yml

# Specify a command to be executed
# like `/bin/bash -l`, `ls`, or any other commands
# the default is bash for Linux
# or powershell.exe for Windows
command: null

# Specify the current working directory path
# the default is the current working directory path
cwd: null

# Export additional ENV variables
env:
  recording: true

# Explicitly set the number of columns
# or use `auto` to take the current
# number of columns of your shell
cols: auto

# Explicitly set the number of rows
# or use `auto` to take the current
# number of rows of your shell
rows: auto

# Amount of times to repeat GIF
# If value is -1, play once
# If value is 0, loop indefinitely
# If value is a positive number, loop n times
repeat: -1

# Quality
# 1 - 100
quality: 100

# Delay between frames in ms
# If the value is `auto` use the actual recording delays
frameDelay: auto

# Maximum delay between frames in ms
# Ignored if the `frameDelay` isn't set to `auto`
# Set to `auto` to prevent limiting the max idle time
maxIdleTime: 2000

# The surrounding frame box
# The `type` can be null, window, floating, or solid`
# To hide the title use the value null
# Don't forget to add a backgroundColor style with a null as type
frameBox:
  type: null
  title: null
  style:
    backgroundColor: black

# Add a watermark image to the rendered gif
# You need to specify an absolute path for
# the image on your machine or a URL, and you can also
# add your own CSS styles
watermark:
  imagePath: null
  style:
    position: absolute
    right: 15px
    bottom: 15px
    width: 100px
    opacity: 0.9

# Cursor style can be one of
# `block`, `underline`, or `bar`
cursorStyle: block

# Font family
# You can use any font that is installed on your machine
# in CSS-like syntax
fontFamily: "monospace"

# The size of the font
fontSize: 32

# The height of lines
lineHeight: 1

# The spacing between letters
letterSpacing: 0

# Theme
theme:
  background: "transparent"
  foreground: "#C5D4DD"
  cursor: "#7FC1CA"
  black: "#3C4C55"
  red: "#DF8C8C"
  green: "#A8CE93"
  yellow: "#DADA93"
  blue: "#83AFE5"
  magenta: "#9A93E1"
  cyan: "#7FC1CA"
  white: "#C5D4DD"
  brightBlack: "#899BA6"
  brightRed: "#F2C38F"
  brightGreen: "#A8CE93"
  brightYellow: "#DADA93"
  brightBlue: "#83AFE5"
  brightMagenta: "#D18EC2"
  brightCyan: "#7FC1CA"
  brightWhite: "#E6EEF3"

Help with rendering best quality GIFs and CSS syntax

Thanks a ton for any helpful feedback

I need help with getting best quality GIFs.

I am not used to CSS syntax so it would be amazing if you add a lot of example config.yml files. Also, try adding config.yml files for the GIFs you are displaying in your README.md. They look fantastic. I have spent hours trying to get perfect GIF but no luck.

I don't know what value to give for shadow and also all my GIFs are very small. Yours looks big with good quality.

Also, how do I reduce the width of the terminal. All my commands are stuck to left and there is so much space on the right.

I am really interested in Floating title-less frame-box with shadow best quality GIF like you display here:

My GIF looks like this:
render1546766039176

Cannot install the package

npm install terminalizer --unsafe-perm=true --allow-root

> [email protected] install /root/.npm/node_modules/node-pty-prebuilt
> prebuild-install || node scripts/install.js

prebuild-install WARN install No prebuilt binaries found (target=11.14.0 runtime=node arch=x64 libc= platform=linux)
gyp ERR! configure error
gyp ERR! stack Error: Command failed: /usr/bin/python3 -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack   File "<string>", line 1
gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack                                ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:299:12)
gyp ERR! stack     at ChildProcess.emit (events.js:193:13)
gyp ERR! stack     at maybeClose (internal/child_process.js:999:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:266:5)
gyp ERR! System Linux 3.10.0-862.14.4.el7.x86_64

Render is not exiting (not doing anything)

So, it's not working. I just repeat waht is in the demo.

ArchLinux here. Node 10.7 ... Quite strange, no errors or anything. Recording is seems okey. And of course i have base-devel since 2015 :D

versions:

~/tunnckoCore/brom/foobar
❯ make -v      
GNU Make 4.2.1
Built for x86_64-unknown-linux-gnu
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

~/tunnckoCore/brom/foobar
❯ gcc -v 
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/8.1.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared --enable-threads=posix --enable-libmpx --with-system-zlib --with-isl --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object --enable-linker-build-id --enable-lto --enable-plugin --enable-install-libiberty --with-linker-hash-style=gnu --enable-gnu-indirect-function --enable-multilib --disable-werror --enable-checking=release --enable-default-pie --enable-default-ssp
Thread model: posix
gcc version 8.1.0 (GCC)

cat of demo.yml (from record command)

❯ cat demo.yml                 
# The configurations that used for the recording, feel free to edit them
config:

  # Specify a command to be executed
  # like `/bin/bash -l`, `ls`, or any other commands
  # the default is bash for Linux
  # or powershell.exe for Windows
  command: bash -l
  
  # Specify the current working directory path
  # the default is the current working directory path
  cwd: /home/charlike/tunnckoCore/brom/foobar
  
  # Export additional ENV variables
  env:
    recording: true
  
  # Explicitly set the number of columns
  # or use `auto` to take the current
  # number of columns of your shell
  cols: 127
  
  # Explicitly set the number of rows
  # or use `auto` to take the current
  # number of rows of your shell
  rows: 52
  
  # Amount of times to repeat GIF
  # If value is -1, play once
  # If value is 0, loop indefinitely
  # If value is a positive number, loop n times
  repeat: 0
  
  # Quality
  # 1 - 100
  quality: 100
  
  # Delay between frames in ms
  # If the value is `auto` use the actual recording delays
  frameDelay: auto
  
  # Maximum delay between frames in ms
  # Ignored if the `frameDelay` isn't set to `auto`
  # Set to `auto` to prevnt limiting the max idle time
  maxIdleTime: 2000
  
  # The surrounding frame box
  # The `type` can be null, window, floating, or solid`
  # To hide the title use the value null
  # Don't forget to add a backgroundColor style with a null as type
  frameBox:
    type: floating
    title: Terminalizer
    style:
      border: 0px black solid
      # boxShadow: none
      # margin: 0px
  
  # Add a watermark image to the rendered gif
  # You need to specify an absolute path for
  # the image on your machine or a url, and you can also
  # add your own CSS styles
  watermark:
    imagePath: null
    style:
      position: absolute
      right: 15px
      bottom: 15px
      width: 100px
      opacity: 0.9
  
  # Cursor style can be one of
  # `block`, `underline`, or `bar`
  cursorStyle: block
  
  # Font family
  # You can use any font that is installed on your machine
  # in CSS-like syntax
  fontFamily: "Monaco, Lucida Console, Ubuntu Mono, Monospace"
  
  # The size of the font
  fontSize: 12
  
  # The height of lines
  lineHeight: 1
  
  # The spacing between letters
  letterSpacing: 0
  
  # Theme
  theme:
    background: "transparent"
    foreground: "#afafaf"
    cursor: "#c7c7c7"
    black: "#232628"
    red: "#fc4384"
    green: "#b3e33b"
    yellow: "#ffa727"
    blue: "#75dff2"
    magenta: "#ae89fe"
    cyan: "#708387"
    white: "#d5d5d0"
    brightBlack: "#626566"
    brightRed: "#ff7fac"
    brightGreen: "#c8ed71"
    brightYellow: "#ebdf86"
    brightBlue: "#75dff2"
    brightMagenta: "#ae89fe"
    brightCyan: "#b1c6ca"
    brightWhite: "#f9f9f4"
  
# Records, feel free to edit them
records:
  - delay: 527
    content: "\e]0;charlike@arckos:~/tunnckoCore/brom/foobar\a\e]7;file://arckos/home/charlike/tunnckoCore/brom/foobar\a\e]0;charlike@arckos:~/tunnckoCore/brom/foobar\a"
  - delay: 19
    content: '[charlike@arckos foobar]$ '
  - delay: 928
    content: "logout\r\n"

Render command hangs unless manually "started" in Electron

I am having an issue where the render command doesn't begin and hangs without any input indefinitely.

However I discovered that if I enable the Electron app to be displayed (as mentioned in #11) and then manually click the "play" button then the render begins and the progress bar appears in the terminal. Then the render is successful.

Not sure what the problem is so raising this as a bug.

Thanks for a brilliant lib.

Install fail on Windows 10

I tried to install on 2 different Windows 10 machines but both fails.
Retried on a Mac and it worked.

I have referred to issue #16 but it doesn't resolve my case.

Versions

nvm v1.1.7
node v11.1.0
npm v6.4.1
python v3.7.0

Error log

 npm i -g terminalizer
C:\Program Files\nodejs\terminalizer -> C:\Program Files\nodejs\node_modules\terminalizer\bin\app.js

> [email protected] install C:\Program Files\nodejs\node_modules\terminalizer\node_modules\node-pty-prebuilt
> prebuild-install || node scripts/install.js

prebuild-install WARN install No prebuilt binaries found (target=11.1.0 runtime=node arch=x64 platform=win32)

C:\ProgramData\nvm\v11.1.0\node_modules\terminalizer\node_modules\node-pty-prebuilt>if not defined npm_config_node_gyp (node "C:\ProgramData\nvm\v11.1.0\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild --build_v8_with_gn=false )  else (node "C:\ProgramData\nvm\v11.1.0\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild --build_v8_with_gn=false )
gyp ERR! configure error
gyp ERR! stack Error: Command failed: C:\tools\miniconda3\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack   File "<string>", line 1
gyp ERR! stack     import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack                                ^
gyp ERR! stack SyntaxError: invalid syntax
gyp ERR! stack
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:289:12)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at maybeClose (internal/child_process.js:970:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:257:5)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\ProgramData\\nvm\\v11.1.0\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--build_v8_with_gn=false"
gyp ERR! cwd C:\ProgramData\nvm\v11.1.0\node_modules\terminalizer\node_modules\node-pty-prebuilt
gyp ERR! node -v v11.1.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `prebuild-install || node scripts/install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\user\AppData\Roaming\npm-cache\_logs\2018-11-07T23_45_34_574Z-debug.log

Error running terminalizer on node v11.3.0

Hello.
Got the following error when starting terminalizer:

Error: Cannot find module '../build/Release/pty.node'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:603:15)
    at Function.Module._load (internal/modules/cjs/loader.js:529:25)
    at Module.require (internal/modules/cjs/loader.js:658:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/home/bruno/.nvm/versions/node/v11.3.0/lib/node_modules/terminalizer/node_modules/node-pty-prebuilt/lib/unixTerminal.js:22:11)
    at Module._compile (internal/modules/cjs/loader.js:722:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:733:10)
    at Module.load (internal/modules/cjs/loader.js:620:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
    at Function.Module._load (internal/modules/cjs/loader.js:552:3)

Feature request: How do I know I'm "playing" a demo?

I want to be noticed when I'm using 'terminalizer play'.
For example, there could be an inspection before the prompt when playing something like:

<playing>[root@localhost ~]# mkdir demo
<playing>[root@localhost ~]# cd demo
<playing>[root@localhost ~]# logout

Therefor I'll know now it's palying, and I'm not taking control of it.

Feature request: Global config

I want to always use zsh and I don't want to add a config file in every folder. It would be great if there was a way to set a global config, maybe in ~/.terminalizerrc or something.

Can't uninstall global npm modules in terminalizer

When I'm inside terminalizer, I can't uninstall npm modules. Say I have eslint installed, and then run

npm rm -g eslint
eslint

I am still able to call eslint. Then, I exit terminalizer, run the same commands, and eslint is no longer on my path.

Any ideas why this might happen?

Render error on Windows 10 x64

I've successfully installed the package after setting up node-gyp and successfully recorded a session, however, the render command fails almost instantly:

image

Seems like delays are shifted in generated GIF

In the GIF rendering, delays happen after the matching content is displayed instead of before as in terminal replays.

This results in glitches such as the first letter of every command being shown quickly after the prompt, then the rest comes after the "I'll wait a bit before starting to type the next command" pause, or the screen being cleared too fast and staying blank for a delay that was intended to be before the clear…

This is easy to confirm with events like so (for me they play as X-dash… X in the terminal, and X… dash-X in the GIF):

records:
  - delay: 1000
    content: " X"
  - delay: 100
    content: " -"
  - delay: 1000
    content: " X"

--config fails to find config file if it is a symlink

$ terminalizer --config path/to/config.yml record hello

If path/to/config.yml is a symlink, then terminalizer fails with an error:

Error: 
  The provided file doesn't exit

Hint:
  Use the --help option to get help about the usage

I believe the problem is that here:

terminalizer/utility.js

Lines 13 to 28 in e06c12d

function isFile(filePath) {
// Resolve the path into an absolute path
filePath = di.path.resolve(filePath);
try {
return di.fs.lstatSync(filePath).isFile();
} catch (error) {
return false;
}
}

fs.lstatSync is being used, where fs.statSync should be used instead.

From the stat manpage:

These functions return information about a file, in the buffer
pointed to by statbuf.  No permissions are required on the file
itself, but—in the case of stat(), fstatat(), and lstat()—execute
(search) permission is required on all of the directories in pathname
that lead to the file.

stat() and fstatat() retrieve information about the file pointed to
by pathname; the differences for fstatat() are described below.

lstat() is identical to stat(), except that if pathname is a symbolic
link, then it returns information about the link itself, not the file
that it refers to.

Testing in the Node REPL:

$ node
> fs.lstatSync("path/to/config.yml").isFile()
false
> fs.statSync("path/to/config.yml").isFile()
true

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.