@@ -14,15 +14,15 @@ def showVersion
1414end
1515def showHelp
1616 print <<EOS
17- Usage:
17+ Usage:
1818 screenxtv [options]
1919
2020Options:
2121 -u, [--url] # Select a url (e.g. yasulab, tompng)
2222 -c, [--color] # Select a color (options: black/white/green/novel)
2323 -t, [--title] # Select a title (e.g. Joe's Codestream)
2424 -r, [--reset] # Reset your default configuration (e.g. url, color, title)
25- -f CONFIG_FILE # Path to a preset configuration
25+ -f CONFIG_FILE # Path to a preset configuration
2626 -p, [--private] # Broadcast your terminal privately (anyone who has the link can access)
2727 -h, [--help] # Show this help message and quit
2828 -v, [--version] # Show ScreenX TV Ruby Client version number and quit
@@ -287,12 +287,17 @@ def auth(conf)
287287}
288288
289289begin
290+ require './record'
291+ h , w = STDIN . winsize
292+ @rec = Recorder . new "#{ ENV [ 'HOME' ] } /screenxtv_rec#{ Time . now . strftime '%m%d%H%M' } .html" , w :w , h :h
293+
290294 ENV [ 'LANG' ] = 'en_US.UTF-8'
291295 screen_name = argv [ :private ] ? conf [ 'screen_private' ] : conf [ 'screen' ]
292296 PTY ::getpty "screen -x #{ screen_name } -R" do |rr , ww |
293297 winsize = -> {
294298 height , width = ww . winsize = rr . winsize = STDOUT . winsize
295299 socket . send 'winch' , { width :width , height :height } . to_json
300+ @rec . write winch :{ w :width , h :height }
296301 }
297302 winsize . call
298303 resized = false
@@ -337,6 +342,7 @@ def auth(conf)
337342 odata = data [ 0 , data . size -ncount ]
338343 print odata
339344 socket . send 'data' , odata
345+ @rec . write data :odata . force_encoding ( 'utf-8' )
340346 data = data [ data . size -ncount , ncount ]
341347 end
342348 end
0 commit comments