@@ -35,20 +35,21 @@ export function activate (_ink) {
35
35
36
36
process . env [ 'TERM' ] = 'xterm-256color'
37
37
38
- subs . add ( atom . config . observe ( 'julia-client.consoleOptions.whitelistedKeybindingsREPL' , ( kbds ) => {
39
- whitelistedKeybindingsREPL = kbds . map ( s => s . toLowerCase ( ) )
40
- } ) )
41
- subs . add ( atom . config . observe ( 'julia-client.consoleOptions.whitelistedKeybindingsTerminal' , ( kbds ) => {
42
- whitelistedKeybindingsTerminal = kbds . map ( s => s . toLowerCase ( ) )
43
- } ) )
44
- subs . add ( atom . config . observe ( 'julia-client.consoleOptions.cursorStyle' , updateTerminalSettings ) )
45
- subs . add ( atom . config . observe ( 'julia-client.consoleOptions.maximumConsoleSize' , updateTerminalSettings ) )
46
- subs . add ( atom . config . observe ( 'julia-client.consoleOptions.macOptionIsMeta' , updateTerminalSettings ) )
47
- subs . add ( atom . config . observe ( 'julia-client.consoleOptions.rendererType' , updateTerminalSettings ) )
48
- subs . add ( atom . config . observe ( 'julia-client.consoleOptions.cursorBlink' , updateTerminalSettings ) )
38
+ subs . add (
39
+ atom . config . observe ( 'julia-client.consoleOptions.whitelistedKeybindingsREPL' , ( kbds ) => {
40
+ whitelistedKeybindingsREPL = kbds . map ( s => s . toLowerCase ( ) )
41
+ } ) ,
42
+ atom . config . observe ( 'julia-client.consoleOptions.whitelistedKeybindingsTerminal' , ( kbds ) => {
43
+ whitelistedKeybindingsTerminal = kbds . map ( s => s . toLowerCase ( ) )
44
+ } ) ,
45
+ atom . config . observe ( 'julia-client.consoleOptions.cursorStyle' , updateTerminalSettings ) ,
46
+ atom . config . observe ( 'julia-client.consoleOptions.maximumConsoleSize' , updateTerminalSettings ) ,
47
+ atom . config . observe ( 'julia-client.consoleOptions.macOptionIsMeta' , updateTerminalSettings ) ,
48
+ atom . config . observe ( 'julia-client.consoleOptions.rendererType' , updateTerminalSettings ) ,
49
+ atom . config . observe ( 'julia-client.consoleOptions.cursorBlink' , updateTerminalSettings )
50
+ )
49
51
50
52
terminal = ink . InkTerminal . fromId ( 'julia-terminal' , terminalOptions ( ) )
51
-
52
53
terminal . setTitle ( 'REPL' , true )
53
54
terminal . class = 'julia-terminal'
54
55
@@ -109,8 +110,8 @@ export function activate (_ink) {
109
110
if ( promptObserver ) promptObserver . dispose ( )
110
111
} )
111
112
112
- // repl commands
113
113
subs . add (
114
+ // repl commands
114
115
atom . commands . add ( 'atom-workspace' , {
115
116
'julia-client:open-REPL' : ( ) => {
116
117
open ( ) . then ( ( ) => terminal . show ( ) )
@@ -125,24 +126,23 @@ export function activate (_ink) {
125
126
atom . commands . dispatch ( terminal . view , 'julia-client:interrupt-julia' )
126
127
}
127
128
}
129
+ } ) ,
130
+ // terminal commands
131
+ atom . commands . add ( 'atom-workspace' , {
132
+ 'julia-client:new-terminal' : ( ) => {
133
+ newTerminal ( )
134
+ } ,
135
+ 'julia-client:new-terminal-from-current-folder' : ev => {
136
+ const dir = evaluation . currentDir ( ev . target )
137
+ if ( ! dir ) return
138
+ newTerminal ( dir )
139
+ } ,
140
+ 'julia-client:new-remote-terminal' : ( ) => {
141
+ newRemoteTerminal ( )
142
+ }
128
143
} )
129
144
)
130
145
131
- // terminal commands
132
- subs . add ( atom . commands . add ( 'atom-workspace' , {
133
- 'julia-client:new-terminal' : ( ) => {
134
- newTerminal ( )
135
- } ,
136
- 'julia-client:new-terminal-from-current-folder' : ev => {
137
- const dir = evaluation . currentDir ( ev . target )
138
- if ( ! dir ) return
139
- newTerminal ( dir )
140
- } ,
141
- 'julia-client:new-remote-terminal' : ( ) => {
142
- newRemoteTerminal ( )
143
- }
144
- } ) )
145
-
146
146
// handle deserialized terminals
147
147
forEachPane ( item => {
148
148
if ( ! item . ty ) {
@@ -351,11 +351,7 @@ export function deactivate () {
351
351
item . detach ( )
352
352
item . close ( )
353
353
} , / t e r m i n a l \- r e m o t e \- j u l i a \- \d + / )
354
- if ( terminal ) {
355
- terminal . detach ( )
356
- }
357
- if ( subs ) {
358
- subs . dispose ( )
359
- }
354
+ if ( terminal ) terminal . detach ( )
355
+ if ( subs ) subs . dispose ( )
360
356
subs = null
361
357
}
0 commit comments