Skip to content

Commit 8300199

Browse files
authored
Merge pull request #660 from JunoLab/sp/webglterm
webgl terminal renderer
2 parents 849fe86 + 6d7ca4d commit 8300199

File tree

2 files changed

+12
-23
lines changed

2 files changed

+12
-23
lines changed

lib/package/config.coffee

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -469,11 +469,15 @@ config =
469469
type: 'boolean'
470470
default: false
471471
order: 8
472-
rendererType:
473-
title: 'Fallback Renderer'
474-
type: 'boolean'
475-
default: false
476-
description: 'Enable this if you\'re experiencing slowdowns in the built-in terminals.'
472+
terminalRendererType:
473+
title: 'Terminal Renderer'
474+
type: 'string'
475+
enum: ['webgl', 'canvas', 'dom']
476+
default: 'webgl'
477+
radio: true
478+
description: 'The `webgl` renderer is fastest, but is still experimental. `canvas` performs well
479+
in many cases, while `dom` is a slow falback. Note that it\'s not possible
480+
to hot-swap to the `webgl` renderer.'
477481
order: 9
478482
remoteOptions:
479483
type: 'object'

lib/runtime/console.js

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export function activate (_ink) {
4545
atom.config.observe('julia-client.consoleOptions.cursorStyle', updateTerminalSettings),
4646
atom.config.observe('julia-client.consoleOptions.maximumConsoleSize', updateTerminalSettings),
4747
atom.config.observe('julia-client.consoleOptions.macOptionIsMeta', updateTerminalSettings),
48-
atom.config.observe('julia-client.consoleOptions.rendererType', updateTerminalSettings),
48+
atom.config.observe('julia-client.consoleOptions.terminalRendererType', updateTerminalSettings),
4949
atom.config.observe('julia-client.consoleOptions.cursorBlink', updateTerminalSettings)
5050
)
5151

@@ -198,7 +198,7 @@ function terminalOptions () {
198198
const opts = {
199199
scrollback: atom.config.get('julia-client.consoleOptions.maximumConsoleSize'),
200200
cursorStyle: atom.config.get('julia-client.consoleOptions.cursorStyle'),
201-
rendererType: atom.config.get('julia-client.consoleOptions.rendererType') ? 'dom' : 'canvas',
201+
rendererType: atom.config.get('julia-client.consoleOptions.terminalRendererType'),
202202
cursorBlink: atom.config.get('julia-client.consoleOptions.cursorBlink'),
203203
}
204204
if (process.platform === 'darwin') {
@@ -211,22 +211,7 @@ function updateTerminalSettings () {
211211
const settings = terminalOptions()
212212
forEachPane((item) => {
213213
for (const key in settings) {
214-
if (key === 'rendererType') {
215-
if (!item.element.initialized) continue
216-
}
217-
try {
218-
const setting = settings[key]
219-
item.terminal.setOption(key, setting)
220-
if (!item.persistentState) {
221-
item.persistentState = { opts: {} }
222-
}
223-
if (!item.persistentState.opts) {
224-
item.persistentState.opts = {}
225-
}
226-
item.persistentState.opts[key] = setting
227-
} catch (err) {
228-
console.warn('Error while applying settings for terminal:', item, err)
229-
}
214+
item.setOption(key, settings[key])
230215
}
231216
}, /terminal\-julia\-\d+|julia\-terminal|terminal\-remote\-julia\-\d+/)
232217
}

0 commit comments

Comments
 (0)