@@ -4,48 +4,41 @@ import { ITerminalOptions, ITheme } from 'xterm';
44import { Xterm } from './terminal' ;
55
66if ( ( module as any ) . hot ) {
7- // tslint:disable-next-line:no-var-requires
8- require ( 'preact/debug' ) ;
7+ // tslint:disable-next-line:no-var-requires
8+ require ( 'preact/debug' ) ;
99}
1010
1111const protocol = window . location . protocol === 'https:' ? 'wss://' : 'ws://' ;
1212const wsPath = window . location . pathname . endsWith ( '/' ) ? 'ws' : '/ws' ;
13- const url = [
14- protocol ,
15- window . location . host ,
16- window . location . pathname ,
17- wsPath ,
18- window . location . search ,
19- ] . join ( '' ) ;
13+ const url = [ protocol , window . location . host , window . location . pathname , wsPath , window . location . search ] . join ( '' ) ;
2014const termOptions = {
21- fontSize : 13 ,
22- fontFamily :
23- 'Menlo For Powerline,Consolas,Liberation Mono,Menlo,Courier,monospace' ,
24- theme : {
25- foreground : '#d2d2d2' ,
26- background : '#2b2b2b' ,
27- cursor : '#adadad' ,
28- black : '#000000' ,
29- red : '#d81e00' ,
30- green : '#5ea702' ,
31- yellow : '#cfae00' ,
32- blue : '#427ab3' ,
33- magenta : '#89658e' ,
34- cyan : '#00a7aa' ,
35- white : '#dbded8' ,
36- brightBlack : '#686a66' ,
37- brightRed : '#f54235' ,
38- brightGreen : '#99e343' ,
39- brightYellow : '#fdeb61' ,
40- brightBlue : '#84b0d8' ,
41- brightMagenta : '#bc94b7' ,
42- brightCyan : '#37e6e8' ,
43- brightWhite : '#f1f1f0' ,
44- } as ITheme ,
15+ fontSize : 13 ,
16+ fontFamily : 'Menlo For Powerline,Consolas,Liberation Mono,Menlo,Courier,monospace' ,
17+ theme : {
18+ foreground : '#d2d2d2' ,
19+ background : '#2b2b2b' ,
20+ cursor : '#adadad' ,
21+ black : '#000000' ,
22+ red : '#d81e00' ,
23+ green : '#5ea702' ,
24+ yellow : '#cfae00' ,
25+ blue : '#427ab3' ,
26+ magenta : '#89658e' ,
27+ cyan : '#00a7aa' ,
28+ white : '#dbded8' ,
29+ brightBlack : '#686a66' ,
30+ brightRed : '#f54235' ,
31+ brightGreen : '#99e343' ,
32+ brightYellow : '#fdeb61' ,
33+ brightBlue : '#84b0d8' ,
34+ brightMagenta : '#bc94b7' ,
35+ brightCyan : '#37e6e8' ,
36+ brightWhite : '#f1f1f0' ,
37+ } as ITheme ,
4538} as ITerminalOptions ;
4639
4740export class App extends Component {
48- render ( ) {
49- return < Xterm id = "terminal-container" url = { url } options = { termOptions } /> ;
50- }
41+ render ( ) {
42+ return < Xterm id = "terminal-container" url = { url } options = { termOptions } /> ;
43+ }
5144}
0 commit comments