Code Monkey home page Code Monkey logo

ttystudio's Introduction

ttystudio

A terminal-to-gif recorder minus the headaches.

ttystudio

Record your terminal and compile it to a GIF or APNG without any external dependencies, bash scripts, gif concatenation, etc.

Install with: $ npm install ttystudio. (Add -g for global install).

Usage

$ ttystudio output.gif --log
  $ vim
    hello world
    :q!
  $ ^Q # stop recording with ctrl-q
initializing writer
writing image
writing head
writing frame 0 - 132 left
writing frame 1 - 131 left
writing frame 2 - 130 left
...
writing frame 131 - 1 left
writing eof
wrote image to /home/chjj/output.gif
$ chromium output.gif
# or if you wrote to output.png (an APNG)
$ firefox output.png

The Difference

ttystudio differs from other terminal recorders in that:

  1. It has its own built-in gif and apng writer, no imagemagick required. The writer now has built-in frame offset optimization.
  2. It has a font parser to render the font during image writing so no terminal playback is required when writing the image (this also means no GUI is required at all - you can record on a remote machine via ssh).
  3. No concatenation of hundreds of gif files required. ttystudio automatically writes out to one gif or apng.
  4. No glitchy frames due to imperfect GUI recording of the playback or gif concatenation.
  5. ttystudio will record frames even if nothing is being updated on the screen.

This project has ended up making use of years of work I've done writing terminal libraries (my personal obsession). Once all the pieces were there, this project became possible. It also sprang out of a need to find a terminal-to-gif recorder that actually worked.

(NOTE: The above .gif was recorded with ttystudio - nested ttystudio instances cause a slight glitch where the cursor is not visible. Not to matter in most cases).

More Usage

$ ttystudio output.gif --log # record and compile
$ ttystudio frames.json --log # record
$ ttystudio frames.json output.gif --range=0-50 # compile

Use a frames.json file

$ ttystudio --record frames.json --interval=100 # grab each frame on a 100ms interval
  $ vim
    hello world
    :q!
  $ ^Q # stop recording with ctrl-q
$ ttystudio --compile frames.json output.gif --log
parsing json
initializing writer
writing image
writing head
writing frame 0 - 132 left
writing frame 1 - 131 left
writing frame 2 - 130 left
...
writing frame 131 - 1 left
writing eof
wrote image to /home/chjj/output.gif
$ chromium output.gif
# or if you wrote to output.png (an APNG)
$ firefox output.png

How it works

  1. $ ttystudio --record frames.json: blessed+term.js+pty.js will spawn a pseudo-terminal to let you record until you press ^Q.
  2. $ ttystudio --compile frames.json output.gif: ttystudio will parse each set of frames into a bitmap, keeping in mind the foreground color and character in each cell.
  3. It will use its parsed font (terminus-u14n/b by default) to render pixels for each characters in the image.
  4. It will write out each frame to a .gif or .png file of your choice.

It's that simple. No bash script to run. No gifs to concatenate. No external dependencies required (i.e. ffmpeg or imagemagick) - ttystudio does it all on its own, in 99% javascript (aside from pty.js which is a node c++ binding to spawn terminals).

Options and Examples

Compiling to APNG:

$ ttystudio frames.json output.png --log

Accidentally recorded something you don't want in your image? The range option can help:

# compile only frames 5 to 130
$ ttystudio frames.json output.gif --log --range=5-130

The delay option sets the delay between frames in the final image:

# 100ms between output frames
$ ttystudio frames.json output.png --log --delay=100

The --no-palette/--rgba option can be used to avoid use a global palette (color type 3) when compiling APNGs (this is known to cause high memory usage when building the palette since it has to parse every frame beforehand). Instead, it will use color type 6 (RGBA). This will make the APNG larger, but does not risk OOMing the process. OOMing the process is unlikely to happen, but if it does, this option is here. Use pngcrush afterwards to optimize.

$ ttystudio frames.json output.png --log --rgba

Piping:

$ ttystudio frames.json - | feh -

Replaying frames in the terminal:

$ ttystudio --play frames.json

Adding a border:

# explanation of arguments:
$ ttystudio output.gif --log --border=[width],[r],[g],[b],[a]
# add a red border:
$ ttystudio output.gif --log --border=10,255,0,0,255
# white border:
$ ttystudio output.gif --log --border=10,255
$ ttystudio output.gif --log --border=10,255,255,255
$ ttystudio output.gif --log --border=10

Start in screenshot mode. This allows you to take multiple screenshot whenever C-p is pressed. ttystudio will write them all to separate images.

$ ttystudio o.gif --screenshot --screenshot-key C-p

Full Options List

  • -l, --log

    • Log status to stderr (now default).
  • -q, --quiet

    • Do not log status to stderr.
  • -f, --font [font-file]

    • Choose a BDF font in ttystudio's JSON format.
  • -b, --font-bold [font-file]

    • Choose a bold BDF font in ttystudio's JSON format.
  • -d, --delay [delay-ms]

    • Specify frame delay in ms (default: 100).
  • -i, --interval [interval-ms]

    • Specify frame snapshot interval in ms (default: 100).
  • -k, --key [quit-key]

    • Choose a key combination to quit recording (default: C-q).
  • -n, --num-plays [num-plays]

    • Specify a number of plays for the animation (default: 0 - infinite).
  • -r, --range [frame-range]

    • Choose a range of frames to compile. e.g. 5-200.
  • -x, --ratio [pixel-cell-ratio]

    • Choose pixel to cell ratio. This option is useless right now since it is overwritten by the font (default: 8x14).
  • -t, --term [term-name]

    • Choose the terminal name for terminfo.
  • --palette

    • Use a global palette for APNGs instead of RGBA.
  • --no-palette, --rgba, --lct

    • Use RGBA for APNGs instead of a global palette. This will also avoid building a global palette for GIFs and only use a local color table for each frame.
  • --border [width,r,g,b,a]

    • Add a border around the animation using the specified parameters.
  • play, --play

    • Replay a frames file in the terminal.
  • record, --record

    • Explicitly choose to record (not very useful).
  • compile, --compile

    • Explicitly choose to compile (not very useful).
  • screenshot, --screenshot

    • Start ttystudio in screenshot mode. It will take a screenshot on C-p unless specified otherwise by --screenshot-key.
  • --screenshot-key

    • Set the screenshot key when in screenshot mode. Default is C-p.
  • --version

    • Display ttystudio version.
  • -h, --help

    • Display help information.

Choosing a new font for your terminal recording

Since ttystudio does not record a GUI, it needs to know which font you want to use (it has no real idea of the font your terminal is using). ttystudio uses terminus (ter-u14n/b) by default, but you can change this.

Your font must be in BDF format. Once you have your font ready, place it in the fonts/ directory in ttystudio and run $ make. ttystudio+pxxl.js will convert the .bdf font to a glyph bitmap format in a json file, which is what ttystudio uses.

$ cp ~/ter-u12n.bdf ~/ttystudio/fonts/
$ cp ~/ter-u12b.bdf ~/ttystudio/fonts/
$ cd ~/ttystudio/fonts
$ make
...
$ ttystudio output.gif --log \
  --font ~/ttystudio/fonts/ter-u12n.json \
  --font-bold ~/ttystudio/fonts/ter-u12b.json

OSX

pty.js seems to currently be causing sporadic input lag on OSX. This is being investigated.

Notes

A special thanks to the folks who developed pxxl.js - a BDF font parser. Without them, it would not have been possible to render a reasonable looking font to the output gif/png.

Todo

  • More fonts and font formats supported.
  • Antialiased fonts.
  • Emit frames as events in writers.

Contribution and License Agreement

If you contribute code to this project, you are implicitly allowing your code to be distributed under the MIT license. You are also implicitly verifying that all code is your original work. </legalese>

License

Copyright (c) 2015, Christopher Jeffrey. (MIT License)

See LICENSE for more info.

ttystudio's People

Contributors

chjj avatar zhiyelee 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

ttystudio's Issues

PtyKill called twice causing assertion failure

I'm not sure if this bug belongs in blessed or in pty.js but it affects ttystudio. I'm writing this here because my fix was specific to getting ttystudio working on Windows. I dug through the issues of all three projects while trying to setup ttystudio but there was no record of this problem.

I'd used ttystudio before on my personal machine(Linux) but had difficulty getting it to install in my Windows workstation at work. Once I had gotten passed issues with getting the pty.js dependency to build (I had to add the --msvs_version= argument for my visual studio when installing via npm), I ran into an issue in the pty.cc native code.

I set the SHELL environment variable to point to C:\Windows\System32\cmd.exe and was able to get ttystudio somewhat working. Once I'd hit ctrl+q though, I'd get a dialog about an assertion failure in pty.cc in the PtyKill method:

static NAN_METHOD(PtyKill) {
  Nan::HandleScope scope;

  if (info.Length() != 1
    || !info[0]->IsNumber()) // pid
  {
    return Nan::ThrowError("Usage: pty.kill(pid)");
  }

  int handle = info[0]->Int32Value();

  winpty_t *pc = get_pipe_handle(handle);

  assert(pc != nullptr);
  winpty_exit(pc);
  assert(true == remove_pipe_handle(handle));

  return info.GetReturnValue().SetUndefined();
}

I eventually clicked debug on the node.exe process in task manager and it was able to pull up the pty.cc source in Visual Studio to set a breakpoint inside the PtyKill method. I found that when I'd end the recording session with ctrl+q, the PtyKill method would get called once successfully, but then would be called again a second time. By the time the method was invoked again, the pipe handle had already been removed by the call to remove_pipe_handle at the end of the first PtyKill invocation. I eventually found where PtyKill was being called twice in one of the source files of the blessed project (lib/widgets/terminal.js):

Terminal.prototype.kill = function() {
  if (this.pty) {
    this.pty.destroy();
    this.pty.kill();
  }
  this.term.refresh = function() {};
  this.term.write('\x1b[H\x1b[J');
  if (this.term._blink) {
    clearInterval(this.term._blink);
  }
  this.term.destroy();
};

The call to destroy() and kill() on the pty object were redundant, as destroy() just contains a call to kill(). I commented out the call to pty.kill() and left the pty.destroy() method in place. This allowed ttystudio to work successfully on my Windows 7 pc with cmd.exe as the shell.

Rendered images not showing in Chrome

This technically isn't a you problem per se.

With your fixes to the other issues in the last few days (thanks you rock) I have finally been able to render a gif. When I open it in chrome the first frame shows then it goes away. If I upload that gif to imgur whatever they do to re-encode it seems to correct the issue.

The rendered gif https://www.dropbox.com/s/la4mfkzpj383o46/fwconsole.gif?dl=0
The imgur gif https://www.dropbox.com/s/ivg0z0f2cogebwr/OrqQBbK.gif?dl=0

I don't know what the difference is or if maybe it is as simple as passing a flag of some sort

NPM install failed

I am using latest Xubuntu, and I could not install the Node package. Console output is:

$ sudo npm -g install ttystudio
> [email protected] install /usr/local/lib/node_modules/ttystudio/node_modules/pty.js
> node-gyp rebuild

/bin/sh: node: command not found
gyp: Call to 'node -e "require('nan')"' returned exit status 127. while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:344:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Linux 3.19.0-22-generic
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/ttystudio/node_modules/pty.js
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok 
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the pty.js package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls pty.js
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.19.0-22-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "-g" "install" "ttystudio"
npm ERR! cwd /home/ern0
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/ern0/npm-debug.log
npm ERR! not ok code 0

Install Fails on Debian 8 Jessie

_Nube Alert_

Its my first ever time dealing with node and npm so there is probably a lot that I am missing.

I did the following:

  1. apt-get install node
  2. apt-get install npm
  3. npm install ttystudio

and I get the following output:

root@debian:/home/ikuru# npm install ttystudio
/

[email protected] install /home/ikuru/node_modules/ttystudio/node_modules/pty.js
node-gyp rebuild

gyp: Call to 'node -e "require('nan')"' returned exit status 1. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:344:16)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:809:12)
gyp ERR! System Linux 3.16.0-4-686-pae
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/ikuru/node_modules/ttystudio/node_modules/pty.js
gyp ERR! node -v v0.10.29
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the pty.js package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls pty.js
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.16.0-4-686-pae
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "ttystudio"
npm ERR! cwd /home/ikuru
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/ikuru/npm-debug.log
npm ERR! not ok code 0
root@debian:/home/ikuru# npm install -g ttystudio
/

[email protected] install /usr/local/lib/node_modules/ttystudio/node_modules/pty.js
node-gyp rebuild

gyp: Call to 'node -e "require('nan')"' returned exit status 1. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:344:16)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:809:12)
gyp ERR! System Linux 3.16.0-4-686-pae
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/ttystudio/node_modules/pty.js
gyp ERR! node -v v0.10.29
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the pty.js package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls pty.js
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.16.0-4-686-pae
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "ttystudio"
npm ERR! cwd /home/ikuru
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/ikuru/npm-debug.log
npm ERR! not ok code 0

Sorry again for the nube-ish issue & thanks in advance!

Failure while writing (events.js:141)

I just tried recording a gif and ran into this:

I made a recording with ttystudio frames.json --log
and then attempted to create a gif with ttystudio frames.json mygif.gif
and am running into this:

...
writing frame 97 - 2 left
frame dimensions: 1x1
writing frame 98 - 1 left
frame dimensions: 1x1
writing eof
events.js:141
      throw er; // Unhandled 'error' event
      ^
Error: EINVAL: invalid argument, write
    at Error (native)

I'm on node v4.1.0 and ttystudio v0.0.16.

Is it possible to know the last frame from a json file ?

Is there a command that would let me know that last frame ? so I can trigger a compile command knowing that last frame (160) before hand --compile --range=0-150 letting me drop the last 10 frames of the series.

Thanks for this project, pretty awesome, cheers.

TypeException on start

Not sure windows is even supported but i get the following error when running ttystudio output.gif

TypeError: Cannot read property 'data' of undefined
    at GIFWriter.writeHead (C:\Users\mgt57_000\AppData\Roaming\npm\node_modules\ttystudio\lib\gif.js:115:13)\lib\pty_win.js:55:9)
    at GIFWriter.write (C:\Users\mgt57_000\AppData\Roaming\npm\node_modules\ttystudio\lib\gif.js:51:8)on (net.js:1191:8)
    at SGRWriter.write (C:\Users\mgt57_000\AppData\Roaming\npm\node_modules\ttystudio\lib\writer.js:53:22)
    at compile (C:\Users\mgt57_000\AppData\Roaming\npm\node_modules\ttystudio\bin\ttystudio:61:10)
    at C:\Users\mgt57_000\AppData\Roaming\npm\node_modules\ttystudio\bin\ttystudio:93:12
    at process.done (C:\Users\mgt57_000\AppData\Roaming\npm\node_modules\ttystudio\lib\record.js:92:7)
    at process.emit (events.js:117:20)
    at process.exit (node.js:711:17)
    at Object._onImmediate (C:\Users\mgt57_000\AppData\Roaming\npm\node_modules\ttystudio\node_modules\blessed\lib\widgets\screen.js:188:15)
    at processImmediate [as _immediateCallback] (timers.js:345:15)

xcode-select error

Node Version: v0.12.9
Python Version: 2

NPM Version: 2.14.9

Alright so when I run npm install ttystudio,
It returns:

> node-gyp rebuild

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

  CXX(target) Release/obj.target/pty/src/unix/pty.o
  SOLINK_MODULE(target) Release/pty.node
[email protected] ../../node_modules/ttystudio
└── [email protected] ([email protected], [email protected])

Does anyone know how to fix this?

display error of bash: command not found in pseudo-terminal while start record

in macOS x HighSierra 10.13.2

I have a custom method in ~/.bash_profile which prompt git branch name in terminal

parse_git_branch() {
    git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
# some other code
export PS1="${GREEN}\u@${YELLOW}\h:${LIGHT_RED}\w${LIGHT_GREEN}\$(parse_git_branch)${WHITE} $ 

now when I start recording with

ttystudio --outout.gif --log

it display error

parse: parse_git_branch: command not found

How to overcome this issue?

Is this project abandoned?

Seems like issues are open for several years, and it fails to install.

if it is abandoned, perhaps mention it somewhere in the README and archive it?
it is still being recommended by some, and I remember that it worked well when it did, so I would love for it to not be abandoned...

Change the prompt of the shell

Hi! I wanted to use a minimal prompt for terminal recordings, but if I do export PS1="\\$ " and then run ttystudio, PS1 seems to be reset to the default.

What can I do to achieve a minimal prompt (like "$ ") in ttystudio?

Can't get mouse events to pass through

Maybe I'm doing something wrong? Just running ttystudio, then running my CLI app (slap) in the new shell. Seems like mouse events are just being ignored. iTerm2 2.1.1 on OSX 10.10.4.

ttystudio ignores `^C` signal

If you want to cancel the writing of a gif you have to manually find the process number and kill it. It would be much easier if standard ^C worked.

Fixed delay between each action on the screen

Sometimes I need to think when I do screencasts, and still want the screencast to proceed smoothly. Is there a possibility to record only those frames where there is action in the screen, and each at the same delay from the previous frame in which there was action? This would effectively cut out the "thinking pauses".

"TypeError: Value is out of bounds" when writing frame 1

Output:

 ~  ttystudio myfile.gif --log
initializing writer
writing image
writing head
writing frame 0 - 59 left
frame dimensions: 640x336
writing frame 1 - 58 left
frame dimensions: 1x1
TypeError: value is out of bounds
    at TypeError (<anonymous>)
    at checkInt (buffer.js:705:11)
    at Buffer.writeUInt8 (buffer.js:715:5)
    at GIFWriter.write8 (/usr/local/lib/node_modules/ttystudio/lib/gif.js:82:7)
    at GIFWriter.writeFrame (/usr/local/lib/node_modules/ttystudio/lib/gif.js:196:12)
    at GIFWriter.write (/usr/local/lib/node_modules/ttystudio/lib/gif.js:61:10)
    at SGRWriter.write (/usr/local/lib/node_modules/ttystudio/lib/writer.js:53:22)
    at compile (/usr/local/lib/node_modules/ttystudio/bin/ttystudio:61:10)
    at /usr/local/lib/node_modules/ttystudio/bin/ttystudio:93:12
    at Screen.done (/usr/local/lib/node_modules/ttystudio/lib/record.js:93:7)

Replicated this error in urxvt and gnome-terminal, with different terminal sizes that definitely weren't 1x1.

[wishlist] support terminal color scheme

I'm using the Solarized dark color scheme in my terminal and vim, but that isn't reflected yet by ttystudio. Recordings look like
out
when really it looks like
screen
From this blog post I gather that it is actually possible to implement it.

Old node version: TypeError: Object m has no method 'writeUIntBE'

I got one of these

initializing writer
writing image
writing head
TypeError: Object m has no method 'writeUIntBE'
    at GIFWriter.writeBE (/usr/local/lib/node_modules/ttystudio/lib/gif.js:97:7)
    at GIFWriter.writeHead (/usr/local/lib/node_modules/ttystudio/lib/gif.js:134:12)
    at GIFWriter.write (/usr/local/lib/node_modules/ttystudio/lib/gif.js:51:8)
    at SGRWriter.write (/usr/local/lib/node_modules/ttystudio/lib/writer.js:53:22)
    at compile (/usr/local/lib/node_modules/ttystudio/bin/ttystudio:61:10)
    at /usr/local/lib/node_modules/ttystudio/bin/ttystudio:93:12
    at Screen.done (/usr/local/lib/node_modules/ttystudio/lib/record.js:92:7)
    at Screen.EventEmitter._emit (/usr/local/lib/node_modules/ttystudio/node_modules/blessed/lib/events.js:90:20)
    at Screen.EventEmitter.emit (/usr/local/lib/node_modules/ttystudio/node_modules/blessed/lib/events.js:107:17)
    at Program.<anonymous> (/usr/local/lib/node_modules/ttystudio/node_modules/blessed/lib/widgets/screen.js:480:12)
probook:TelcareOperations ivan$ vim /usr/local/lib/node_modules/ttystudio/lib/gif.js

when node -v === v0.10.35 but then upgrading to v0.12.4 and some npm uninstall and reinstall stuff later it works now. Awesome app, BTW.

run ttystudio with no flags should show help

if ttystudio is run without flags a new shell is started rather than presenting the user the help page. It seems there is no point in having ttystudio create a new session if the output has not been set. Might be better to just default to $ ttystudio -h implicitly

JavaScript heap out of memory.

Hi,

whatever I try, when recording a terminal session I get an OOM. I use the following versions (OSX);

ttystudio --version
v0.0.16
node --version
v6.4.0
<--- Last few GCs --->

  162367 ms: Mark-sweep 1241.3 (1435.0) -> 1241.0 (1435.0) MB, 545.5 / 0 ms [last resort gc].
  162383 ms: Scavenge 1241.8 (1435.0) -> 1241.8 (1435.0) MB, 9.5 / 0 ms [allocation failure].
  162386 ms: Scavenge 1241.8 (1435.0) -> 1241.8 (1435.0) MB, 3.2 / 0 ms [allocation failure].
  162931 ms: Mark-sweep 1241.8 (1435.0) -> 1241.8 (1435.0) MB, 544.7 / 0 ms [last resort gc].
  163475 ms: Mark-sweep 1241.8 (1435.0) -> 1241.6 (1435.0) MB, 544.4 / 0 ms [last resort gc].


<--- JS stacktrace --->

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

Security context: 0x2bf8773c9e31 <JS Object>
    1: stringify [native json.js:164] [pc=0x26776d333d77] (this=0x2bf8773bac69 <a JSON with map 0x3b903d008721>,z=0x18edafa352b1 <JS Array[1561]>,A=0x2bf877304189 <undefined>,N=0x2bf877304189 <undefined>)
    2: arguments adaptor frame: 1->3
    3: /* anonymous */ [/usr/local/lib/node_modules/ttystudio/bin/ttystudio:41] [pc=0x26776d69d2e5] (this=0x2bf8773e1d81 <JS Global Object>,err=0x2bf877304...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [/usr/local/bin/node]
 2: node::FatalException(v8::Isolate*, v8::Local<v8::Value>, v8::Local<v8::Message>) [/usr/local/bin/node]
 3: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [/usr/local/bin/node]
 4: v8::internal::Factory::NewRawTwoByteString(int, v8::internal::PretenureFlag) [/usr/local/bin/node]
 5: v8::internal::IncrementalStringBuilder::Extend() [/usr/local/bin/node]
 6: v8::internal::BasicJsonStringifier::SerializeSmi(v8::internal::Smi*) [/usr/local/bin/node]
 7: v8::internal::BasicJsonStringifier::Result v8::internal::BasicJsonStringifier::Serialize_<false>(v8::internal::Handle<v8::internal::Object>, bool, v8::internal::Handle<v8::internal::Object>) [/usr/local/bin/node]
 8: v8::internal::BasicJsonStringifier::Result v8::internal::BasicJsonStringifier::Serialize_<false>(v8::internal::Handle<v8::internal::Object>, bool, v8::internal::Handle<v8::internal::Object>) [/usr/local/bin/node]
 9: v8::internal::BasicJsonStringifier::Result v8::internal::BasicJsonStringifier::Serialize_<false>(v8::internal::Handle<v8::internal::Object>, bool, v8::internal::Handle<v8::internal::Object>) [/usr/local/bin/node]
10: v8::internal::BasicJsonStringifier::Result v8::internal::BasicJsonStringifier::Serialize_<false>(v8::internal::Handle<v8::internal::Object>, bool, v8::internal::Handle<v8::internal::Object>) [/usr/local/bin/node]
11: v8::internal::BasicJsonStringifier::Result v8::internal::BasicJsonStringifier::Serialize_<false>(v8::internal::Handle<v8::internal::Object>, bool, v8::internal::Handle<v8::internal::Object>) [/usr/local/bin/node]
12: v8::internal::Runtime_BasicJSONStringify(int, v8::internal::Object**, v8::internal::Isolate*) [/usr/local/bin/node]
13: 0x26776d20961b
14: 0x26776d333d77
fish: 'ttystudio --record test…' terminated by signal SIGABRT (Abort)

ttystudio not terminating

on Linux Mint 17

~$ ttystudio test.gif --log
...
writing frame 268 - 7 left
writing frame 269 - 6 left
writing frame 270 - 5 left
writing frame 271 - 4 left
writing frame 272 - 3 left
writing frame 273 - 2 left
writing frame 274 - 1 left
writing eof

it stopped there. After ~20 Minutes i canceled it. The resulting gif file is incomplete.

Progress Bar display error

When recording something that involves progress bars the font conversion or similar means that several display bars are incorrectly displayed

progress_bar_demonstration

os x installation error

hey there,

the installation fails in os x:

tell the author that this fails on your system:
node-gyp rebuild

os x version
10.11.5

node --version
v6.2.1

npm --version
3.9.6

cheers maik

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.