Browse files

add new tool ttyreccast

  • Loading branch information...
1 parent 88a2600 commit 74d4ddc61772bb06d4511259cbefd316102eb4f1 @dtinth committed Feb 2, 2013
Showing with 37 additions and 13 deletions.
  1. +23 −12 README.md
  2. +2 −1 package.json
  3. +12 −0 ttyreccast
View
35 README.md
@@ -28,25 +28,22 @@ Install ttycast:
npm install -g ttycast
-
-Running
+Running (Broadcast & Record)
-------
-In your terminal emulator, create a named pipe and pipe it using `ttyplay -n` to ttycast.
+First, set your terminal to the size that you prefer to broadcast, then run the script:
- mkfifo /tmp/ttycast && ttyplay -n /tmp/ttycast | ttycast -s 80x25; rm /tmp/ttycast
+ ttyreccast outfile.tty
-Open your browser and navigate to the server.
+Open your browser and navigate to the server. You should see a blank black screen.
http://localhost:13377/
-Then, spawn a new 80x25 terminal window and start recording:
+Then, open a new terminal of __the same size__ and run this command:
reset && ttyrec /tmp/ttycast
-Then you should see characters appearing in real-time. After using, don't forget to `rm /tmp/ttycast`!
-
-(not working? Then try using normal files. Scroll all the way down.)
+You should see your terminal screen on the web browser now. Recorded output goes into `outfile.tty`.
@@ -56,10 +53,24 @@ Changing Port
ttycast uses the PORT environment variable but the default port is 13377
-Changing Terminal Size
-----------------------
-Just change the `-s` switch from `80x25` to something else. Make sure it matches with the terminal you're using.
+Running (manual way)
+--------------------
+
+In your terminal emulator, create a named pipe and pipe it using `ttyplay -n` to ttycast.
+
+ mkfifo /tmp/ttycast && ttyplay -n /tmp/ttycast | ttycast -s 80x25; rm /tmp/ttycast
+
+Open your browser and navigate to the server.
+
+ http://localhost:13377/
+
+Then, spawn a new 80x25 terminal window and start recording:
+
+ reset && ttyrec /tmp/ttycast
+
+Then you should see characters appearing in real-time. After using, don't forget to `rm /tmp/ttycast`!
+
Piping Via SSH
View
3 package.json
@@ -11,7 +11,8 @@
"send": "*"
},
"bin": {
- "ttycast": "./app.js"
+ "ttycast": "./app.js",
+ "ttyreccast": "./ttyreccast"
},
"devDependencies": {},
"scripts": {
View
12 ttyreccast
@@ -0,0 +1,12 @@
+#!/bin/bash
+set -e
+set -x
+
+lines=$(tput lines)
+cols=$(tput cols)
+temp=$(mktemp -u -t ttyrec)
+rm -f /tmp/ttycast
+mkfifo -m 600 "$temp" /tmp/ttycast
+
+cat /tmp/ttycast | tee "$@" > "$temp" & ttyplay -n "$temp" | ttycast -s $cols"x"$lines
+rm -f /tmp/ttycast "$temp"

0 comments on commit 74d4ddc

Please sign in to comment.