added DECALN control sequence support

This commit is contained in:
Roman Shevchenko 2019-01-14 10:58:26 +00:00
parent ac6ccbb0fd
commit a1a3d176d1
2 changed files with 27 additions and 1 deletions

View File

@ -13,7 +13,8 @@ var ansiSequenceMap = map[rune]escapeSequenceHandler{
'D': indexHandler,
'M': reverseIndexHandler,
'P': sixelHandler,
'c': risHandler, //RIS
'c': risHandler, //RIS
'#': screenStateHandler,
'(': swallowHandler(1), // character set bullshit
')': swallowHandler(1), // character set bullshit
'*': swallowHandler(1), // character set bullshit

25
terminal/scr_state.go Normal file
View File

@ -0,0 +1,25 @@
package terminal
import "fmt"
func screenStateHandler(pty chan rune, terminal *Terminal) error {
b := <-pty
switch b {
case '8': // DECALN -- Screen Alignment Pattern
// hide cursor?
// reset margins to extreme positions
buffer := terminal.ActiveBuffer()
buffer.SetPosition(0, 0)
// Fill the whole screen with E's
count := buffer.ViewHeight() * buffer.ViewWidth()
for count > 0 {
buffer.Write('E')
count--
}
// restore cursor?
default:
return fmt.Errorf("Screen State code not supported: 0x%02X [%v]", b, string(b))
}
return nil
}