Merge pull request #2076 from steve02081504/staging

fix #2071: Set window title as `SillyTavern WebServer`
This commit is contained in:
Cohee
2024-04-13 21:47:44 +03:00
committed by GitHub

View File

@@ -499,11 +499,14 @@ const setupTasks = async function () {
const cleanupPlugins = await loadPlugins();
const BackUpTitle = process.title;
const exitProcess = async () => {
statsEndpoint.onExit();
if (typeof cleanupPlugins === 'function') {
await cleanupPlugins();
}
setWindowTitle(BackUpTitle);
process.exit();
};
@@ -520,6 +523,8 @@ const setupTasks = async function () {
if (autorun) open(autorunUrl.toString());
setWindowTitle('SillyTavern WebServer');
console.log(color.green('SillyTavern is listening on: ' + tavernUrl));
if (listen) {
@@ -587,3 +592,10 @@ function ensurePublicDirectoriesExist() {
}
}
}
function setWindowTitle(title) {
if (process.platform == 'win32')
process.title = title
else
process.stdout.write('\x1b]2;' + title + '\x1b\x5c')
}