File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed
renderer/terminal/components Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change 11import { BrowserWindow , ipcMain } from 'electron'
22import { getTerminalStore } from '../lib/store'
33import * as window from '../lib/window'
4- import isWindows from 'licia/isWindows'
5- import contain from 'licia/contain'
64import isBuffer from 'licia/isBuffer'
75
86const store = getTerminalStore ( )
@@ -59,12 +57,16 @@ export function init() {
5957 if ( isBuffer ( data ) ) {
6058 data = data . toString ( 'utf8' )
6159 }
62- if ( isWindows && contain ( data , '|' ) ) {
63- data = ( data as string ) . replace ( / \ufffd / g, '█' )
64- }
6560 logs . push ( data as string )
66- window . sendAll ( 'addLog' , data )
61+ window . sendTo ( 'terminal' , 'addLog' , data )
62+ }
63+
64+ function logError ( err : Error ) {
65+ console . error ( err )
6766 }
67+
68+ process . on ( 'uncaughtException' , logError )
69+ process . on ( 'unhandledRejection' , logError )
6870}
6971
7072function initIpc ( ) {
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ export default observer(function () {
5353 main . getLogs ( ) . then ( ( logs : string [ ] ) => {
5454 each ( logs , ( log ) => write ( log ) )
5555 } )
56- main . on ( 'addLog' , ( event , log ) => write ( log ) )
56+ main . on ( 'addLog' , ( log ) => write ( log ) )
5757
5858 termRef . current = term
5959
You can’t perform that action at this time.
0 commit comments