@a = 0x000007 # cursor attributes
@partial = ''
@saved_normal_screen = null
+ @cursor_visible = true
@resize width, height
resize: (width, height) ->
@attributes[y] = []
for x in [0...width]
@text[y].push ' '
- @attributes[y].push 0
+ @attributes[y].push 0x07
# pass data from stdout
update: (data) ->
# clear top line
for i in [0...@width]
@text[0][i] = ' '
- @attributes[0][i] = 0
+ @attributes[0][i] = 0x07
# move (newly cleared) top line to the bottom
tmp = @text.shift()
@text.push(tmp)
for i in arguments
arg = @fix_esc_arg i, ''
switch arg
+ when '25'
+ @cursor_visible = true
when '1049'
if @saved_normal_screen?
console.log "ignoring request to switch to the alt screen because we're already on the alt screen"
@attributes[y] = []
for x in [0...@width]
@text[y].push ' '
- @attributes[y].push 0
+ @attributes[y].push 0x07
else
console.log "confusing arg for csiq_h: #{arg}"
# unmisc
for i in arguments
arg = @fix_esc_arg i, ''
switch arg
+ when '25'
+ @cursor_visible = false
when '1049'
if not @saved_normal_screen?
console.log "ignoring request to switch to the normal screen because we're already on the normal screen"