(cancel: boolean = false, noClean: boolean = false, exitCode?: number)
| 288 | }; |
| 289 | |
| 290 | const done = (cancel: boolean = false, noClean: boolean = false, exitCode?: number) => { |
| 291 | if (!noClean) { |
| 292 | clean(); |
| 293 | } |
| 294 | getSshChannel().appendLine(cancel ? localize('ssh.terminal.command.canceled', '"{0}" terminal command canceled.', nickname) : localize('ssh.terminal.command.done', '"{0}" terminal command done.', nickname)); |
| 295 | |
| 296 | if (cancel) { |
| 297 | if (continueWithoutExiting) { |
| 298 | const warningMessage: string = localize('ssh.continuing.command.canceled', 'Task \'{0}\' is canceled, but the underlying command may not be terminated. Please check manually.', command); |
| 299 | getSshChannel().appendLine(warningMessage); |
| 300 | void vscode.window.showWarningMessage(warningMessage); |
| 301 | } |
| 302 | return result.reject(new CanceledError()); |
| 303 | } |
| 304 | |
| 305 | // When using showLoginTerminal, stdout include the passphrase prompt, etc. Try to get just the command output on the last line. |
| 306 | const actualOutput: string | undefined = cancel ? '' : lastNonemptyLine(stdout); |
| 307 | result.resolve({ succeeded: !exitCode, exitCode, outputError: '', output: actualOutput || '' }); |
| 308 | }; |
| 309 | |
| 310 | const failed = (error?: any) => { |
| 311 | clean(); |
no test coverage detected