@@ -204,36 +204,42 @@ export class PtyService extends Disposable implements IPtyService {
204204
205205 @traceRpc
206206 async reviveTerminalProcesses ( state : ISerializedTerminalState [ ] , dateTimeFormatLocale : string ) {
207+ const promises : Promise < void > [ ] = [ ] ;
207208 for ( const terminal of state ) {
208- const restoreMessage = localize ( 'terminal-history-restored' , "History restored" ) ;
209- // TODO: We may at some point want to show date information in a hover via a custom sequence:
210- // new Date(terminal.timestamp).toLocaleDateString(dateTimeFormatLocale)
211- // new Date(terminal.timestamp).toLocaleTimeString(dateTimeFormatLocale)
212- const newId = await this . createProcess (
213- {
214- ...terminal . shellLaunchConfig ,
215- cwd : terminal . processDetails . cwd ,
216- color : terminal . processDetails . color ,
217- icon : terminal . processDetails . icon ,
218- name : terminal . processDetails . titleSource === TitleEventSource . Api ? terminal . processDetails . title : undefined ,
219- initialText : terminal . replayEvent . events [ 0 ] . data + formatMessageForTerminal ( restoreMessage , { loudFormatting : true } )
220- } ,
221- terminal . processDetails . cwd ,
222- terminal . replayEvent . events [ 0 ] . cols ,
223- terminal . replayEvent . events [ 0 ] . rows ,
224- terminal . unicodeVersion ,
225- terminal . processLaunchConfig . env ,
226- terminal . processLaunchConfig . executableEnv ,
227- terminal . processLaunchConfig . options ,
228- true ,
229- terminal . processDetails . workspaceId ,
230- terminal . processDetails . workspaceName ,
231- true ,
232- terminal . replayEvent . events [ 0 ] . data
233- ) ;
234- // Don't start the process here as there's no terminal to answer CPR
235- this . _revivedPtyIdMap . set ( terminal . id , { newId, state : terminal } ) ;
209+ promises . push ( this . _reviveTerminalProcess ( terminal ) ) ;
236210 }
211+ await Promise . all ( promises ) ;
212+ }
213+
214+ private async _reviveTerminalProcess ( terminal : ISerializedTerminalState ) : Promise < void > {
215+ const restoreMessage = localize ( 'terminal-history-restored' , "History restored" ) ;
216+ // TODO: We may at some point want to show date information in a hover via a custom sequence:
217+ // new Date(terminal.timestamp).toLocaleDateString(dateTimeFormatLocale)
218+ // new Date(terminal.timestamp).toLocaleTimeString(dateTimeFormatLocale)
219+ const newId = await this . createProcess (
220+ {
221+ ...terminal . shellLaunchConfig ,
222+ cwd : terminal . processDetails . cwd ,
223+ color : terminal . processDetails . color ,
224+ icon : terminal . processDetails . icon ,
225+ name : terminal . processDetails . titleSource === TitleEventSource . Api ? terminal . processDetails . title : undefined ,
226+ initialText : terminal . replayEvent . events [ 0 ] . data + formatMessageForTerminal ( restoreMessage , { loudFormatting : true } )
227+ } ,
228+ terminal . processDetails . cwd ,
229+ terminal . replayEvent . events [ 0 ] . cols ,
230+ terminal . replayEvent . events [ 0 ] . rows ,
231+ terminal . unicodeVersion ,
232+ terminal . processLaunchConfig . env ,
233+ terminal . processLaunchConfig . executableEnv ,
234+ terminal . processLaunchConfig . options ,
235+ true ,
236+ terminal . processDetails . workspaceId ,
237+ terminal . processDetails . workspaceName ,
238+ true ,
239+ terminal . replayEvent . events [ 0 ] . data
240+ ) ;
241+ // Don't start the process here as there's no terminal to answer CPR
242+ this . _revivedPtyIdMap . set ( terminal . id , { newId, state : terminal } ) ;
237243 }
238244
239245 @traceRpc
0 commit comments