X-Git-Url: https://jasonwoof.com/gitweb/?p=watch-my-terminal.git;a=blobdiff_plain;f=terminal.coffee;h=d371476211fea5315282b427a82bebcb9b64769b;hp=12d8a74a3fdc8d7c8571b5fbd326eecac2663ceb;hb=469415c385464dc424c37f4602bf59233bbaa738;hpb=5a99a6ff19d3eed9231a9820bcd76bb824eb6d32 diff --git a/terminal.coffee b/terminal.coffee index 12d8a74..d371476 100644 --- a/terminal.coffee +++ b/terminal.coffee @@ -19,6 +19,7 @@ class Terminal @a = 0x000007 # cursor attributes @partial = '' @saved_normal_screen = null + @cursor_visible = true @resize width, height resize: (width, height) -> @@ -32,7 +33,7 @@ class Terminal @attributes[y] = [] for x in [0...width] @text[y].push ' ' - @attributes[y].push 0 + @attributes[y].push 0x07 # pass data from stdout update: (data) -> @@ -56,7 +57,7 @@ class Terminal # 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) @@ -220,6 +221,8 @@ class Terminal 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" @@ -232,7 +235,7 @@ class Terminal @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 @@ -241,6 +244,8 @@ class Terminal 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"