JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
Add commandline args for term dimensions
authorJason Woofenden <jason@jasonwoof.com>
Thu, 2 Apr 2015 21:01:34 +0000 (17:01 -0400)
committerJason Woofenden <jason@jasonwoof.com>
Thu, 2 Apr 2015 21:01:34 +0000 (17:01 -0400)
and update the docs

README.md
run.sh
server.coffee

index 3f859fc..48a540e 100644 (file)
--- a/README.md
+++ b/README.md
@@ -41,13 +41,8 @@ systems.
 Configure
 =========
 
-For many programs to render correctly, you'll need to configure
-watch-my-terminal to use the exact same dimensions as your terminal. Run this:
-
-       echo $LINES $COLUMNS
-
-and then edit server.coffee. At the top you will see where you can set the
-number of lines and columns, and (if you wish) change the port.
+You can set the http port and default terminal dimensions by editing
+server.coffee
 
 
 Run
@@ -55,7 +50,7 @@ Run
 
 To start making your terminal viewable, cd to this directory, and run:
 
-       ./run.sh
+       ./run.sh $COLUMNS $LINES
 
 Then test that it's working by opening up http://localhost:2218/ in your
 favorite web browser (assuming your favorite web-browser does javascript.)
@@ -64,7 +59,7 @@ watch-my-terminal listens on all your ip addresses by default, so your terminal
 contents are now accessible to the whole network. Also, you can replace
 "localhost" in that link with something that points at your computer, and share
 the link with others on your network (or the internet if you're not
-firewalled.)
+firewalled.) If you are firewalled, check out the -R option of ssh.
 
 
 Feedback, Questions, Bugs, etc.
diff --git a/run.sh b/run.sh
index 8c9ce4b..a5cb085 100755 (executable)
--- a/run.sh
+++ b/run.sh
@@ -2,4 +2,4 @@
 
 # run from source directory
 
-script -f >(coffee server.coffee >log.txt 2>&1)
+script -f >(coffee server.coffee "$@" >log.txt 2>&1)
index 4f9dc14..f79fe33 100644 (file)
@@ -3,6 +3,11 @@ term_columns = 97
 term_lines = 63
 http_port = 2218
 
+if process.argv.length > 2
+       term_columns = parseInt process.argv[2]
+if process.argv.length > 3
+       term_lines = parseInt process.argv[3]
+
 
 handler = (req, res) ->
        reply_err = (req, res, msg) ->