diff --git a/fonts/Hack-Bold.ttf b/fonts/Hack-Bold.ttf new file mode 100644 index 0000000..7ff4975 Binary files /dev/null and b/fonts/Hack-Bold.ttf differ diff --git a/fonts/Hack-BoldItalic.ttf b/fonts/Hack-BoldItalic.ttf new file mode 100644 index 0000000..3b137d9 Binary files /dev/null and b/fonts/Hack-BoldItalic.ttf differ diff --git a/fonts/Hack-Italic.ttf b/fonts/Hack-Italic.ttf new file mode 100644 index 0000000..d26198a Binary files /dev/null and b/fonts/Hack-Italic.ttf differ diff --git a/fonts/Hack-Regular.ttf b/fonts/Hack-Regular.ttf new file mode 100644 index 0000000..92a90cb Binary files /dev/null and b/fonts/Hack-Regular.ttf differ diff --git a/gui/gui.go b/gui/gui.go index cb24213..71f9833 100644 --- a/gui/gui.go +++ b/gui/gui.go @@ -37,7 +37,7 @@ func New(config *config.Config, terminal *terminal.Terminal, logger *zap.Sugared width: 600, height: 300, terminal: terminal, - fontScale: 15.0, + fontScale: 14.0, } } @@ -121,7 +121,7 @@ func (gui *GUI) Render() error { gl.BindFragDataLocation(program, 0, gl.Str("outColour\x00")) gui.logger.Debugf("Loading font...") - if err := gui.loadFont("./fonts/envypn-15.ttf"); err != nil { + if err := gui.loadFont("./fonts/Hack-Regular.ttf"); err != nil { //if err := gui.loadFont("./fonts/Roboto.ttf"); err != nil { return fmt.Errorf("Failed to load font: %s", err) } diff --git a/terminal/csi.go b/terminal/csi.go index 8178d3e..3706867 100644 --- a/terminal/csi.go +++ b/terminal/csi.go @@ -7,16 +7,33 @@ import ( ) var csiSequenceMap = map[rune]csiSequenceHandler{ - 'm': sgrSequenceHandler, - 'P': csiDeleteHandler, - 'J': csiEraseInDisplayHandler, - 'K': csiEraseInLineHandler, + 'd': csiLinePositionAbsolute, 'h': csiSetModeHandler, 'l': csiResetModeHandler, - 'd': csiLinePositionAbsolute, - 't': csiWindowManipulation, - 'X': csiEraseCharactersHandler, + 'm': sgrSequenceHandler, 'r': csiSetMarginsHandler, + 't': csiWindowManipulation, + 'J': csiEraseInDisplayHandler, + 'K': csiEraseInLineHandler, + 'P': csiDeleteHandler, + 'T': csiScrollHandler, + 'X': csiEraseCharactersHandler, +} + +func csiScrollHandler(params []string, intermediate string, terminal *Terminal) error { + distance := 1 + if len(params) > 1 { + return fmt.Errorf("Not supported") + } + if len(params) == 1 { + var err error + distance, err = strconv.Atoi(params[0]) + if err != nil { + distance = 1 + } + } + terminal.ScrollDown(uint16(distance)) + return nil } // DECSTBM @@ -41,12 +58,14 @@ func csiSetMarginsHandler(params []string, intermediate string, terminal *Termin } } } - top -= 1 - bottom -= 1 + top-- + bottom-- + + terminal.logger.Warnf("Request to set margins from line %d to %d", top, bottom) terminal.ActiveBuffer().SetPosition(0, 0) - return nil + return fmt.Errorf("Not supported") } func csiSetMode(modeStr string, enabled bool, terminal *Terminal) error {