Skip to content

Commit

Permalink
refactor: remove terminal window renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
b-ma committed May 21, 2024
1 parent 1f10abc commit ffec9d3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 23 deletions.
1 change: 1 addition & 0 deletions src/client/Socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ class Socket {
connectionRefusedLogged = true;
}

// retry in 1 second
setTimeout(trySocket, 1000);
}
}
Expand Down
23 changes: 0 additions & 23 deletions src/server/Server.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,27 +80,6 @@ const DEFAULT_CONFIG = {

const TOKEN_VALID_DURATION = 20; // sec

// set terminal title
/** @private */
function setTerminalTitle(server) {
let title = '';

if (server._auditState !== null) {
const numClients = server._auditState.get('numClients');
let numClientStrings = [];
for (let name in numClients) {
numClientStrings.push(`${name}: ${numClients[name]}`);
}

title = `${server.config.app.name} | ${numClientStrings.join(' - ')}`;
} else {
title = `${server.config.app.name}`;
}

const msg = String.fromCharCode(27) + ']0;' + title + String.fromCharCode(7);
process.stdout.write(msg);
}

/**
* The `Server` class is the main entry point for the server-side of a soundworks
* application.
Expand Down Expand Up @@ -337,7 +316,6 @@ class Server {
this.stateManager.registerSchema(AUDIT_STATE_NAME, auditSchema);

logger.configure(this.config.env.verbose);
setTerminalTitle(this);
}

/**
Expand Down Expand Up @@ -386,7 +364,6 @@ class Server {
}
/** @private */
this._auditState = await this.stateManager.create(AUDIT_STATE_NAME, { numClients });
this._auditState.onUpdate(() => setTerminalTitle(this));

// basic http authentication
if (this.config.env.auth) {
Expand Down

0 comments on commit ffec9d3

Please sign in to comment.