Merge branch 'staging' into neo-server

This commit is contained in:
Cohee
2024-04-13 21:52:23 +03:00
12 changed files with 322 additions and 105 deletions

View File

@ -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(
{