(title: string, settings: LoadedSettings)
| 348 | } |
| 349 | |
| 350 | function setWindowTitle(title: string, settings: LoadedSettings) { |
| 351 | if (!settings.merged.hideWindowTitle) { |
| 352 | const windowTitle = (process.env['CLI_TITLE'] || `Anus - ${title}`).replace( |
| 353 | // eslint-disable-next-line no-control-regex |
| 354 | /[\x00-\x1F\x7F]/g, |
| 355 | '', |
| 356 | ); |
| 357 | process.stdout.write(`\x1b]2;${windowTitle}\x07`); |
| 358 | |
| 359 | process.on('exit', () => { |
| 360 | process.stdout.write(`\x1b]2;\x07`); |
| 361 | }); |
| 362 | } |
| 363 | } |