mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-03-03 19:37:46 +01:00
Merge pull request #2076 from steve02081504/staging
fix #2071: Set window title as `SillyTavern WebServer`
This commit is contained in:
commit
f0bce909f6
12
server.js
12
server.js
@ -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')
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user