+
+ # misc
+ csiq_h: ->
+ args = []
+ for i in arguments
+ switch @fix_esc_arg i, ''
+ when '1049'
+ if @saved_normal_screen?
+ console.log "ignoring request to switch to the alt screen because we're already on the alt screen"
+ return
+ @saved_normal_screen = [@x, @y, @text, @attributes]
+ @text = []
+ @attributes = []
+ for y in [0...@height]
+ @text[y] = []
+ @attributes[y] = []
+ for x in [0...@width]
+ @text[y].push ' '
+ @attributes[y].push 0
+ # unmisc
+ csiq_l: ->
+ args = []
+ for i in arguments
+ switch @fix_esc_arg i, ''
+ 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"
+ return
+ @x = @saved_normal_screen[0]
+ @y = @saved_normal_screen[1]
+ @text = @saved_normal_screen[2]
+ @attributes = @saved_normal_screen[3]
+ @saved_normal_screen = null