57
58
case ActionType.TerminalCommandExecuted: {
59
>
const part: TerminalContentPart = {
reducer.ts
60
>
type: 'command',
61
>
commandId: action.commandId,
62
>
commandLine: action.commandLine,
63
>
output: '',
64
>
timestamp: action.timestamp,
65
>
isComplete: false,
66
>
};
67
>
return {
68
>
...state,
69
>
content: [...state.content, part],
70
>
supportsCommandDetection: true,
71
>
};
72
>
}
73
74
case ActionType.TerminalCommandFinished: {
75
>
const content = state.content.map(p => {
reducer.ts
76
>
if (p.type === 'command' && p.commandId === action.commandId) {
77
>
return {
78
>
...p,
79
>
isComplete: true as const,
80
>
exitCode: action.exitCode,
81
>
durationMs: action.durationMs,
82
>
};
83
>
}
84
return p;
86
>
return { ...state, content };
87
>
}
88
89
default: