Add WebGL and links addons for xterm.js

This commit is contained in:
Søren L. Hansen
2021-04-22 12:44:06 -07:00
parent 8d7358b3b3
commit 0dfc5aed76
9 changed files with 47 additions and 14 deletions

View File

@@ -154,9 +154,12 @@ func (server *Server) processWSConn(ctx context.Context, conn *websocket.Conn) e
if server.options.Height > 0 {
opts = append(opts, webtty.WithFixedRows(server.options.Height))
}
if server.options.Preferences != nil {
opts = append(opts, webtty.WithMasterPreferences(server.options.Preferences))
if server.options.Preferences == nil {
server.options.Preferences = &HtermPrefernces{}
}
// Awkward hack until HtermPreferences can be phased out
server.options.Preferences.EnableWebGL = server.options.EnableWebGL
opts = append(opts, webtty.WithMasterPreferences(server.options.Preferences))
tty, err := webtty.New(&wsWrapper{conn}, slave, opts...)
if err != nil {