3
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
4
*--------------------------------------------------------------------------------------------*/
5
5
6
- import { Emitter } from 'vs/base/common/event' ;
6
+ import { Emitter , Event } from 'vs/base/common/event' ;
7
7
import { Disposable , toDisposable } from 'vs/base/common/lifecycle' ;
8
8
import { IProcessEnvironment , OperatingSystem , isWindows } from 'vs/base/common/platform' ;
9
9
import { ProxyChannel } from 'vs/base/parts/ipc/common/ipc' ;
10
10
import { IConfigurationService } from 'vs/platform/configuration/common/configuration' ;
11
- import { ILogService } from 'vs/platform/log/common/log' ;
11
+ import { ILogService , ILoggerService } from 'vs/platform/log/common/log' ;
12
+ import { RemoteLoggerChannelClient } from 'vs/platform/log/common/logIpc' ;
12
13
import { getResolvedShellEnv } from 'vs/platform/shell/node/shellEnv' ;
13
14
import { IPtyHostProcessReplayEvent } from 'vs/platform/terminal/common/capabilities/capabilities' ;
14
15
import { RequestStore } from 'vs/platform/terminal/common/requestStore' ;
@@ -77,7 +78,7 @@ export class PtyHostService extends Disposable implements IPtyService {
77
78
private readonly _ptyHostStarter : IPtyHostStarter ,
78
79
@IConfigurationService private readonly _configurationService : IConfigurationService ,
79
80
@ILogService private readonly _logService : ILogService ,
80
- // @ILoggerService private readonly _loggerService: ILoggerService,
81
+ @ILoggerService private readonly _loggerService : ILoggerService ,
81
82
) {
82
83
super ( ) ;
83
84
@@ -152,9 +153,6 @@ export class PtyHostService extends Disposable implements IPtyService {
152
153
}
153
154
} ) ) ;
154
155
155
- // TODO: Setup logging
156
- // this._register(new RemoteLoggerChannelClient(this._loggerService, client.getChannel(TerminalIpcChannels.Logger)));
157
-
158
156
// Create proxy and forward events
159
157
const proxy = ProxyChannel . toService < IPtyService > ( client . getChannel ( TerminalIpcChannels . PtyHost ) ) ;
160
158
this . _register ( proxy . onProcessData ( e => this . _onProcessData . fire ( e ) ) ) ;
@@ -165,6 +163,12 @@ export class PtyHostService extends Disposable implements IPtyService {
165
163
this . _register ( proxy . onProcessOrphanQuestion ( e => this . _onProcessOrphanQuestion . fire ( e ) ) ) ;
166
164
this . _register ( proxy . onDidRequestDetach ( e => this . _onDidRequestDetach . fire ( e ) ) ) ;
167
165
166
+ // HACK: When RemoteLoggerChannelClient is not delayed, the Pty Host log file won't show up
167
+ // in the Output view of the first window?
168
+ Event . once ( Event . any ( proxy . onProcessReady , proxy . onProcessReplay ) ) ( ( ) => {
169
+ this . _register ( new RemoteLoggerChannelClient ( this . _loggerService , client . getChannel ( TerminalIpcChannels . Logger ) ) ) ;
170
+ } ) ;
171
+
168
172
return [ connection , proxy ] ;
169
173
}
170
174
0 commit comments