Skip to content

Commit

Permalink
feat: set process and xterm title
Browse files Browse the repository at this point in the history
  • Loading branch information
simonhaenisch committed Aug 19, 2019
1 parent 1c72f4b commit 04b985e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cli.ts
Expand Up @@ -50,6 +50,8 @@ const cliFlags = arg({
// Main

async function main(args: typeof cliFlags, config: Config) {
setProcessAndTermTitle('md-to-pdf');

if (args['--version']) {
return console.log(require('./package').version);
}
Expand Down Expand Up @@ -111,6 +113,11 @@ async function main(args: typeof cliFlags, config: Config) {
.catch((error: Error) => (args['--debug'] && console.error(error)) || process.exit(1));
}

function setProcessAndTermTitle(title: string) {
process.title = title;
process.stdout.write(`${String.fromCharCode(27)}]0;${title}${String.fromCharCode(7)}`);
}

// --
// Run

Expand Down

0 comments on commit 04b985e

Please sign in to comment.