Handle special charset setting

openid
Marcin Kulik 13 years ago
parent 22b4da210c
commit 5a54654dc5

@ -8,7 +8,7 @@ class AsciiIo.ScreenBuffer
@cursorY = 0 @cursorY = 0
@brush = AsciiIo.Brush.create({}) @brush = AsciiIo.Brush.create({})
@charsetModifier = @usCharsetModifier @setCharset('us')
topMargin: -> topMargin: ->
@scrollRegion.getTop() @scrollRegion.getTop()
@ -291,3 +291,28 @@ class AsciiIo.ScreenBuffer
@fill @cursorY, @cursorX, n, " " @fill @cursorY, @cursorX, n, " "
@updateLine() @updateLine()
# ------ Charset control
setCharset: (charset) ->
@charset = charset
switch charset
when 'uk'
@charsetModifier = @ukCharsetModifier
when 'us'
@charsetModifier = @usCharsetModifier
when 'special'
@charsetModifier = @specialCharsetModifier
getCharset: ->
@charset
usCharsetModifier: (char) ->
char
ukCharsetModifier: (char) ->
char
specialCharsetModifier: (char) ->
AsciiIo.SpecialCharset[char.charCodeAt(0)] or char

@ -109,6 +109,9 @@ class AsciiIo.VT
last = data[data.length - 1] last = data[data.length - 1]
switch last switch last
when "0"
if intermediate is '('
@setSpecialCharset()
when "7" when "7"
@saveTerminalState() @saveTerminalState()
when "8" when "8"

Loading…
Cancel
Save