(data: string, nickname: string)
| 499 | } |
| 500 | |
| 501 | function logReceivedData(data: string, nickname: string): void { |
| 502 | const logData: string = data.replace(/\r?\n$/, ''); // Trim single trailing newline for nicer log |
| 503 | if (logData === ' ') { |
| 504 | // From the sleep command that must periodically echo ' ' |
| 505 | return; |
| 506 | } |
| 507 | const markedLines: string = logData |
| 508 | .split(/\n/) |
| 509 | .map(line => `${nickname}> ${line}`) |
| 510 | .join('\n'); |
| 511 | |
| 512 | getSshChannel().appendLine(markedLines); |
| 513 | } |
| 514 | |
| 515 | function lastNonemptyLine(str: string): string | undefined { |
| 516 | const lines: string[] = splitLines(str); |
no test coverage detected