mirror of
https://github.com/lone-cloud/gerbil
synced 2026-06-03 19:54:44 -07:00
fix terminal display on windows, better cspell
This commit is contained in:
parent
1c5bd49e3c
commit
e1ef8596e5
4 changed files with 153 additions and 134 deletions
82
.cspell/project-terms.txt
Normal file
82
.cspell/project-terms.txt
Normal file
|
|
@ -0,0 +1,82 @@
|
||||||
|
AMDGPU
|
||||||
|
APPIMAGE
|
||||||
|
BLAS
|
||||||
|
CUDA
|
||||||
|
GGUF
|
||||||
|
KOBOLDAI
|
||||||
|
KOBOLDCPP
|
||||||
|
OLDPC
|
||||||
|
ROCM
|
||||||
|
SDXL
|
||||||
|
SPACEBAR
|
||||||
|
Consolas
|
||||||
|
Cooldown
|
||||||
|
Dolfino
|
||||||
|
Flashattention
|
||||||
|
KoboldCpp
|
||||||
|
Lowvram
|
||||||
|
Segoe
|
||||||
|
Tauri
|
||||||
|
asar
|
||||||
|
clblast
|
||||||
|
clinfo
|
||||||
|
contextsize
|
||||||
|
cublas
|
||||||
|
cuda
|
||||||
|
finetuned
|
||||||
|
flashattention
|
||||||
|
friendlykobold
|
||||||
|
geforce
|
||||||
|
ggml
|
||||||
|
gguf
|
||||||
|
gpulayers
|
||||||
|
hipblas
|
||||||
|
kcpps
|
||||||
|
kcppt
|
||||||
|
koboldai
|
||||||
|
koboldcpp
|
||||||
|
lora
|
||||||
|
lowvram
|
||||||
|
maximizable
|
||||||
|
minimizable
|
||||||
|
mmproj
|
||||||
|
mmq
|
||||||
|
multiuser
|
||||||
|
noavx
|
||||||
|
nocertify
|
||||||
|
nocuda
|
||||||
|
noheader
|
||||||
|
nommq
|
||||||
|
noshift
|
||||||
|
nsis
|
||||||
|
nvidia
|
||||||
|
oldpc
|
||||||
|
opencl
|
||||||
|
pkexec
|
||||||
|
quantmatmul
|
||||||
|
radeon
|
||||||
|
remotetunnel
|
||||||
|
rocm
|
||||||
|
rocminfo
|
||||||
|
safetensors
|
||||||
|
sdclipg
|
||||||
|
sdclipl
|
||||||
|
sdlora
|
||||||
|
sdmodel
|
||||||
|
sdphotomaker
|
||||||
|
sdui
|
||||||
|
sdvae
|
||||||
|
sonarjs
|
||||||
|
taskkill
|
||||||
|
togglefullscreen
|
||||||
|
treemap
|
||||||
|
trycloudflare
|
||||||
|
unquantized
|
||||||
|
useclblast
|
||||||
|
usecuda
|
||||||
|
usevulkan
|
||||||
|
vram
|
||||||
|
vulkan
|
||||||
|
vulkaninfo
|
||||||
|
wayland
|
||||||
|
websearch
|
||||||
119
cspell.json
119
cspell.json
|
|
@ -1,91 +1,25 @@
|
||||||
{
|
{
|
||||||
"version": "0.2",
|
"version": "0.2",
|
||||||
"language": "en",
|
"language": "en",
|
||||||
// Only project-specific terms that aren't covered by built-in dictionaries
|
"dictionaryDefinitions": [
|
||||||
"words": [
|
{
|
||||||
"AMDGPU",
|
"name": "project-terms",
|
||||||
"APPIMAGE",
|
"path": "./.cspell/project-terms.txt",
|
||||||
"asar",
|
"addWords": true
|
||||||
"BLAS",
|
}
|
||||||
"clblast",
|
],
|
||||||
"clinfo",
|
"dictionaries": [
|
||||||
"contextsize",
|
"typescript",
|
||||||
"Cooldown",
|
"node",
|
||||||
"cublas",
|
"npm",
|
||||||
"cuda",
|
"html",
|
||||||
"CUDA",
|
"css",
|
||||||
"Dolfino",
|
"bash",
|
||||||
"Egor",
|
"en-gb",
|
||||||
"finetuned",
|
"companies",
|
||||||
"flashattention",
|
"softwareTerms",
|
||||||
"Flashattention",
|
"misc",
|
||||||
"friendlykobold",
|
"project-terms"
|
||||||
"geforce",
|
|
||||||
"ggml",
|
|
||||||
"gguf",
|
|
||||||
"GGUF",
|
|
||||||
"gpulayers",
|
|
||||||
"hipblas",
|
|
||||||
"kcpps",
|
|
||||||
"kcppt",
|
|
||||||
"koboldai",
|
|
||||||
"KoboldAI",
|
|
||||||
"KOBOLDAI",
|
|
||||||
"koboldcpp",
|
|
||||||
"KoboldCpp",
|
|
||||||
"lora",
|
|
||||||
"lowvram",
|
|
||||||
"Lowvram",
|
|
||||||
"maximizable",
|
|
||||||
"minimizable",
|
|
||||||
"mmproj",
|
|
||||||
"mmq",
|
|
||||||
"multiuser",
|
|
||||||
"noavx",
|
|
||||||
"nocertify",
|
|
||||||
"nocuda",
|
|
||||||
"noheader",
|
|
||||||
"nommq",
|
|
||||||
"noshift",
|
|
||||||
"nsis",
|
|
||||||
"nvidia",
|
|
||||||
"oldpc",
|
|
||||||
"OLDPC",
|
|
||||||
"opencl",
|
|
||||||
"Papi",
|
|
||||||
"Philippov",
|
|
||||||
"pkexec",
|
|
||||||
"PYTHONDONTWRITEBYTECODE",
|
|
||||||
"PYTHONUNBUFFERED",
|
|
||||||
"quantmatmul",
|
|
||||||
"radeon",
|
|
||||||
"remotetunnel",
|
|
||||||
"rocm",
|
|
||||||
"ROCM",
|
|
||||||
"rocminfo",
|
|
||||||
"safetensors",
|
|
||||||
"sdclipg",
|
|
||||||
"sdclipl",
|
|
||||||
"sdlora",
|
|
||||||
"sdmodel",
|
|
||||||
"sdphotomaker",
|
|
||||||
"sdui",
|
|
||||||
"sdvae",
|
|
||||||
"SDXL",
|
|
||||||
"sonarjs",
|
|
||||||
"Tauri",
|
|
||||||
"togglefullscreen",
|
|
||||||
"treemap",
|
|
||||||
"trycloudflare",
|
|
||||||
"unquantized",
|
|
||||||
"useclblast",
|
|
||||||
"usecuda",
|
|
||||||
"usevulkan",
|
|
||||||
"vram",
|
|
||||||
"vulkan",
|
|
||||||
"vulkaninfo",
|
|
||||||
"wayland",
|
|
||||||
"websearch"
|
|
||||||
],
|
],
|
||||||
"ignorePaths": [
|
"ignorePaths": [
|
||||||
"node_modules/**",
|
"node_modules/**",
|
||||||
|
|
@ -101,19 +35,8 @@
|
||||||
"coverage/**",
|
"coverage/**",
|
||||||
".git/**",
|
".git/**",
|
||||||
".vscode/**",
|
".vscode/**",
|
||||||
"*.map"
|
"*.map",
|
||||||
],
|
".cspell/**"
|
||||||
"dictionaries": [
|
|
||||||
"typescript",
|
|
||||||
"node",
|
|
||||||
"npm",
|
|
||||||
"html",
|
|
||||||
"css",
|
|
||||||
"bash",
|
|
||||||
"en-gb",
|
|
||||||
"companies",
|
|
||||||
"softwareTerms",
|
|
||||||
"misc"
|
|
||||||
],
|
],
|
||||||
"languageSettings": [
|
"languageSettings": [
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,6 @@ export const TerminalTab = ({ onServerReady }: TerminalTabProps) => {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const cleanup = window.electronAPI.kobold.onKoboldOutput((data: string) => {
|
const cleanup = window.electronAPI.kobold.onKoboldOutput((data: string) => {
|
||||||
setTerminalContent((prev) => {
|
setTerminalContent((prev) => {
|
||||||
const lines = prev.split('\n');
|
|
||||||
const newData = data.toString();
|
const newData = data.toString();
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
|
@ -66,28 +65,7 @@ export const TerminalTab = ({ onServerReady }: TerminalTabProps) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newData.includes('\r')) {
|
return prev + newData;
|
||||||
const parts = newData.split('\r');
|
|
||||||
|
|
||||||
for (let i = 0; i < parts.length; i++) {
|
|
||||||
if (i === 0) {
|
|
||||||
if (lines.length > 0) {
|
|
||||||
lines[lines.length - 1] += parts[i];
|
|
||||||
} else {
|
|
||||||
lines.push(parts[i]);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (lines.length > 0) {
|
|
||||||
lines[lines.length - 1] = parts[i];
|
|
||||||
} else {
|
|
||||||
lines.push(parts[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return lines.join('\n');
|
|
||||||
} else {
|
|
||||||
return prev + newData;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -612,10 +612,9 @@ export class KoboldCppManager {
|
||||||
if (!existsSync(versionPath)) {
|
if (!existsSync(versionPath)) {
|
||||||
throw new Error('Selected version file does not exist');
|
throw new Error('Selected version file does not exist');
|
||||||
}
|
}
|
||||||
|
|
||||||
this.koboldProcess = spawn(versionPath, args, {
|
this.koboldProcess = spawn(versionPath, args, {
|
||||||
stdio: ['ignore', 'pipe', 'pipe'],
|
stdio: ['pipe', 'pipe', 'pipe'],
|
||||||
shell: process.platform === 'win32',
|
detached: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (onOutput) {
|
if (onOutput) {
|
||||||
|
|
@ -939,7 +938,6 @@ export class KoboldCppManager {
|
||||||
const child = spawn(currentVersion.path, finalArgs, {
|
const child = spawn(currentVersion.path, finalArgs, {
|
||||||
stdio: ['pipe', 'pipe', 'pipe'],
|
stdio: ['pipe', 'pipe', 'pipe'],
|
||||||
detached: false,
|
detached: false,
|
||||||
shell: process.platform === 'win32',
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.koboldProcess = child;
|
this.koboldProcess = child;
|
||||||
|
|
@ -1057,18 +1055,56 @@ export class KoboldCppManager {
|
||||||
this.koboldProcess.once('error', cleanup);
|
this.koboldProcess.once('error', cleanup);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
this.koboldProcess.kill('SIGTERM');
|
if (process.platform === 'win32') {
|
||||||
|
const pid = this.koboldProcess.pid;
|
||||||
setTimeout(() => {
|
if (pid) {
|
||||||
if (this.koboldProcess && !this.koboldProcess.killed) {
|
|
||||||
try {
|
try {
|
||||||
this.koboldProcess.kill('SIGKILL');
|
this.koboldProcess.kill('SIGTERM');
|
||||||
} catch {
|
|
||||||
void 0;
|
setTimeout(() => {
|
||||||
|
if (this.koboldProcess && !this.koboldProcess.killed) {
|
||||||
|
const { exec: execCmd } = require('child_process');
|
||||||
|
execCmd(
|
||||||
|
`taskkill /pid ${pid} /t /f`,
|
||||||
|
(error: Error | null) => {
|
||||||
|
if (error) {
|
||||||
|
this.logManager.logError(
|
||||||
|
'Error force-killing process:',
|
||||||
|
error
|
||||||
|
);
|
||||||
|
}
|
||||||
|
cleanup();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
cleanup();
|
||||||
|
}
|
||||||
|
}, 2000);
|
||||||
|
} catch (error) {
|
||||||
|
this.logManager.logError(
|
||||||
|
'Error during Windows cleanup:',
|
||||||
|
error as Error
|
||||||
|
);
|
||||||
|
cleanup();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
cleanup();
|
||||||
}
|
}
|
||||||
cleanup();
|
} else {
|
||||||
}, 3000);
|
// Unix-like systems
|
||||||
|
this.koboldProcess.kill('SIGTERM');
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
if (this.koboldProcess && !this.koboldProcess.killed) {
|
||||||
|
try {
|
||||||
|
this.koboldProcess.kill('SIGKILL');
|
||||||
|
} catch {
|
||||||
|
void 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cleanup();
|
||||||
|
}, 3000);
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logManager.logError('Error during cleanup:', error as Error);
|
this.logManager.logError('Error during cleanup:', error as Error);
|
||||||
cleanup();
|
cleanup();
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue