Skip to content

Commit e8c4147

Browse files
authored
Solve brwap dangling process (#893)
Fixes #828
1 parent b972721 commit e8c4147

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/application.js

+20
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,23 @@ application.connect("open", (_self, files, hint) => {
3939
load().catch(console.error);
4040
});
4141

42+
let proc_biome;
43+
4244
application.connect("startup", () => {
45+
// biome lsp-proxy starts a background server
46+
// it does not get stopped and leaves a process hanging
47+
// so manage it manually instead
48+
// See https://github.com/workbenchdev/Workbench/issues/828
49+
const subprocess_launcher = Gio.SubprocessLauncher.new(
50+
Gio.SubprocessFlags.STDERR_SILENCE,
51+
);
52+
proc_biome = subprocess_launcher.spawnv([
53+
"biome",
54+
"__run_server",
55+
"--config-path",
56+
pkg.pkgdatadir,
57+
]);
58+
4359
Library({
4460
application,
4561
});
@@ -53,6 +69,10 @@ application.connect("startup", () => {
5369
restoreSessions().catch(console.error);
5470
});
5571

72+
application.connect("shutdown", () => {
73+
proc_biome?.force_exit();
74+
});
75+
5676
application.connect("activate", () => {
5777
if (application.is_remote) {
5878
bootstrap().catch(console.error);

0 commit comments

Comments
 (0)