chjj / ttystudio

A terminal-to-gif recorder minus the headaches.
Other
3.24k stars 93 forks source link

Open in the current directory #15

Open IonicaBizau opened 9 years ago

IonicaBizau commented 9 years ago

Seems like now it opens in the user home.

gunar commented 8 years ago

same here

Miserlou commented 8 years ago

Big +1.

Even a way to call a "setup" script would be okay, so that I could cd ~/demo; source env/bin/activate; vim my_project.py; before recording begins

webavant commented 8 years ago

Set up your environment before launching the ttystudio command, e.g:

HOME=/path/to/my/project ttystudio output.gif

Works on Mac/*Nix. Can't remember how to do it on Windows, but it's slightly less trivial.

Regarding a "setup" script, investigate setting up your terminal profile. ttystudio uses the node blessed and term.js libraries to launch the program shell configured in your SHELL environment variable. It defaults to 'sh', which is aliased to bash on most systems, or to other streamlined shells in barebones systems. If your SHELL is not already customized, Macs and most linux distros are configured with defaults to automatically load ~/.bash_profile and ~/.bashrc immediately upon login before even displaying the prompt. The best solution is to change the SHELL environmental variable before launching ttystudio. Write a shell script to to launch vim immediately inside of ttystudio's new shell instance, then set SHELL to that path, e.g. SHELL=/my/script/path/file ttystudio output.gif.

For the trifecta (twofecta?), combine the two in a one-liner:

HOME=/path/to/my/project SHELL=/my/script/path/file ttystudio output.gif