mirror of
https://github.com/lone-cloud/gerbil
synced 2026-06-03 09:33:10 -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",
|
||||
"language": "en",
|
||||
// Only project-specific terms that aren't covered by built-in dictionaries
|
||||
"words": [
|
||||
"AMDGPU",
|
||||
"APPIMAGE",
|
||||
"asar",
|
||||
"BLAS",
|
||||
"clblast",
|
||||
"clinfo",
|
||||
"contextsize",
|
||||
"Cooldown",
|
||||
"cublas",
|
||||
"cuda",
|
||||
"CUDA",
|
||||
"Dolfino",
|
||||
"Egor",
|
||||
"finetuned",
|
||||
"flashattention",
|
||||
"Flashattention",
|
||||
"friendlykobold",
|
||||
"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"
|
||||
"dictionaryDefinitions": [
|
||||
{
|
||||
"name": "project-terms",
|
||||
"path": "./.cspell/project-terms.txt",
|
||||
"addWords": true
|
||||
}
|
||||
],
|
||||
"dictionaries": [
|
||||
"typescript",
|
||||
"node",
|
||||
"npm",
|
||||
"html",
|
||||
"css",
|
||||
"bash",
|
||||
"en-gb",
|
||||
"companies",
|
||||
"softwareTerms",
|
||||
"misc",
|
||||
"project-terms"
|
||||
],
|
||||
"ignorePaths": [
|
||||
"node_modules/**",
|
||||
|
|
@ -101,19 +35,8 @@
|
|||
"coverage/**",
|
||||
".git/**",
|
||||
".vscode/**",
|
||||
"*.map"
|
||||
],
|
||||
"dictionaries": [
|
||||
"typescript",
|
||||
"node",
|
||||
"npm",
|
||||
"html",
|
||||
"css",
|
||||
"bash",
|
||||
"en-gb",
|
||||
"companies",
|
||||
"softwareTerms",
|
||||
"misc"
|
||||
"*.map",
|
||||
".cspell/**"
|
||||
],
|
||||
"languageSettings": [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -50,7 +50,6 @@ export const TerminalTab = ({ onServerReady }: TerminalTabProps) => {
|
|||
useEffect(() => {
|
||||
const cleanup = window.electronAPI.kobold.onKoboldOutput((data: string) => {
|
||||
setTerminalContent((prev) => {
|
||||
const lines = prev.split('\n');
|
||||
const newData = data.toString();
|
||||
|
||||
if (
|
||||
|
|
@ -66,28 +65,7 @@ export const TerminalTab = ({ onServerReady }: TerminalTabProps) => {
|
|||
}
|
||||
}
|
||||
|
||||
if (newData.includes('\r')) {
|
||||
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)) {
|
||||
throw new Error('Selected version file does not exist');
|
||||
}
|
||||
|
||||
this.koboldProcess = spawn(versionPath, args, {
|
||||
stdio: ['ignore', 'pipe', 'pipe'],
|
||||
shell: process.platform === 'win32',
|
||||
stdio: ['pipe', 'pipe', 'pipe'],
|
||||
detached: false,
|
||||
});
|
||||
|
||||
if (onOutput) {
|
||||
|
|
@ -939,7 +938,6 @@ export class KoboldCppManager {
|
|||
const child = spawn(currentVersion.path, finalArgs, {
|
||||
stdio: ['pipe', 'pipe', 'pipe'],
|
||||
detached: false,
|
||||
shell: process.platform === 'win32',
|
||||
});
|
||||
|
||||
this.koboldProcess = child;
|
||||
|
|
@ -1057,6 +1055,43 @@ export class KoboldCppManager {
|
|||
this.koboldProcess.once('error', cleanup);
|
||||
|
||||
try {
|
||||
if (process.platform === 'win32') {
|
||||
const pid = this.koboldProcess.pid;
|
||||
if (pid) {
|
||||
try {
|
||||
this.koboldProcess.kill('SIGTERM');
|
||||
|
||||
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();
|
||||
}
|
||||
} else {
|
||||
// Unix-like systems
|
||||
this.koboldProcess.kill('SIGTERM');
|
||||
|
||||
setTimeout(() => {
|
||||
|
|
@ -1069,6 +1104,7 @@ export class KoboldCppManager {
|
|||
}
|
||||
cleanup();
|
||||
}, 3000);
|
||||
}
|
||||
} catch (error) {
|
||||
this.logManager.logError('Error during cleanup:', error as Error);
|
||||
cleanup();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue