mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Merge branch 'staging' into neo-server
This commit is contained in:
17
server.js
17
server.js
@ -556,12 +556,14 @@ const setupTasks = async function () {
|
||||
await statsEndpoint.init();
|
||||
|
||||
const cleanupPlugins = await loadPlugins();
|
||||
const consoleTitle = process.title;
|
||||
|
||||
const exitProcess = async () => {
|
||||
statsEndpoint.onExit();
|
||||
if (typeof cleanupPlugins === 'function') {
|
||||
await cleanupPlugins();
|
||||
}
|
||||
setWindowTitle(consoleTitle);
|
||||
process.exit();
|
||||
};
|
||||
|
||||
@ -578,6 +580,8 @@ const setupTasks = async function () {
|
||||
|
||||
if (autorun) open(autorunUrl.toString());
|
||||
|
||||
setWindowTitle('SillyTavern WebServer');
|
||||
|
||||
console.log(color.green('SillyTavern is listening on: ' + tavernUrl));
|
||||
|
||||
if (listen) {
|
||||
@ -619,6 +623,19 @@ if (listen && !enableWhitelist && !basicAuthMode) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the title of the terminal window
|
||||
* @param {string} title Desired title for the window
|
||||
*/
|
||||
function setWindowTitle(title) {
|
||||
if (process.platform === 'win32') {
|
||||
process.title = title;
|
||||
}
|
||||
else {
|
||||
process.stdout.write(`\x1b]2;${title}\x1b\x5c`);
|
||||
}
|
||||
}
|
||||
|
||||
if (cliArguments.ssl) {
|
||||
https.createServer(
|
||||
{
|
||||
|
Reference in New Issue
Block a user