Skip to content

Conversation

@gmartina
Copy link
Contributor

@gmartina gmartina commented Nov 9, 2025

fixes #726
fixes #817

Summary

  • Added two new settings: teroshdl.cleanup.killServerProcesses.enabled (default false) and teroshdl.cleanup.killServerProcesses.gracePeriodMs (ms).

  • Implemented safe cleanup in rust_hdl.ts and verible.ts: pgrep -f via execFile, PID validation, send SIGTERM then SIGKILL after the grace period.

  • Cleanup runs only when enabled and the session is Remote‑SSH (vscode.env.remoteName check).

  • Added a Web UI indicator + commands (teroshdl.cleanup.openSettings)

Why I implemented the config option in VS Code settings:

VS Code settings give per-scope granularity: User (global), Workspace (project), and Remote (per-SSH-host).

Tests

I could not debug Teros extension when using it over SSH. So I had to build a release and test it.

Disabled

image
admin@debian-server:~$ ps aux | grep vhdl_ls
admin       3218  2.2  0.1  13352  7428 ?        Ssl  12:54   0:00 /home/admin/.vscode-server/extensions/teros-technology.teroshdl-8.0.10/server/vhdl_ls/0.84.0/vhdl_ls-x86_64-unknown-linux-musl/bin/vhdl_ls --silent
admin       3360  4.5  2.1 100240 86308 ?        Ssl  12:54   0:00 /home/admin/.vscode-server/extensions/teros-technology.teroshdl-8.0.10/server/vhdl_ls/0.84.0/vhdl_ls-x86_64-unknown-linux-musl/bin/vhdl_ls --silent
admin       3401  0.0  0.0   6604  2252 pts/0    S+   12:55   0:00 grep vhdl_ls
admin@debian-server:~$ ps aux | grep vhdl_ls
admin       3218  2.1  0.1  13352  7428 ?        Ssl  12:54   0:00 /home/admin/.vscode-server/extensions/teros-technology.teroshdl-8.0.10/server/vhdl_ls/0.84.0/vhdl_ls-x86_64-unknown-linux-musl/bin/vhdl_ls --silent
admin       3360  4.1  2.1 100240 86308 ?        Ssl  12:54   0:00 /home/admin/.vscode-server/extensions/teros-technology.teroshdl-8.0.10/server/vhdl_ls/0.84.0/vhdl_ls-x86_64-unknown-linux-musl/bin/vhdl_ls --silent
admin       3403  0.0  0.0   6604  2188 pts/0    S+   12:55   0:00 grep vhdl_ls
admin@debian-server:~$ ps aux | grep vhdl_ls
admin       3218  0.7  0.1  13352  7428 ?        Ssl  12:54   0:00 /home/admin/.vscode-server/extensions/teros-technology.teroshdl-8.0.10/server/vhdl_ls/0.84.0/vhdl_ls-x86_64-unknown-linux-musl/bin/vhdl_ls --silent
admin       3360  0.5  0.1  13416  7524 ?        Ssl  12:54   0:00 /home/admin/.vscode-server/extensions/teros-technology.teroshdl-8.0.10/server/vhdl_ls/0.84.0/vhdl_ls-x86_64-unknown-linux-musl/bin/vhdl_ls --silent
admin       3464  0.8  2.1 100296 86380 ?        Ssl  12:55   0:00 /home/admin/.vscode-server/extensions/teros-technology.teroshdl-8.0.10/server/vhdl_ls/0.84.0/vhdl_ls-x86_64-unknown-linux-musl/bin/vhdl_ls --silent
admin       3713  3.0  0.1  13400  7480 ?        Ssl  12:56   0:00 /home/admin/.vscode-server/extensions/teros-technology.teroshdl-8.0.10/server/vhdl_ls/0.84.0/vhdl_ls-x86_64-unknown-linux-musl/bin/vhdl_ls --silent
admin       3756  0.0  0.0   6604  2192 pts/0    S+   12:56   0:00 grep vhdl_ls

Enabled

image image
admin@debian-server:~$ ps aux | grep vhdl_ls
admin       4710  0.0  0.0   6604  2272 pts/0    S+   13:01   0:00 grep vhdl_ls
admin@debian-server:~$ ps aux | grep vhdl_ls
admin       4713  0.0  0.0   6604  2244 pts/0    S+   13:01   0:00 grep vhdl_ls
admin@debian-server:~$ ps aux | grep verible
admin       4715  0.0  0.0   6604  2104 pts/0    S+   13:01   0:00 grep verible
admin@debian-server:~$ ps aux | grep vhdl_ls
admin       4717  0.0  0.0   6604  2232 pts/0    S+   13:01   0:00 grep vhdl_ls
admin@debian-server:~$ 

Language server shutdown process when using ssh
@qarlosalberto
Copy link
Contributor

Please check the conflicts.

@gmartina
Copy link
Contributor Author

@qarlosalberto How can I add this through auto_package?

        "configuration": {
            "type": "object",
            "title": "TerosHDL",
            "properties": {
                "teroshdl.cleanup.killServerProcesses.enabled": {
                    "type": "boolean",
                    "default": false,
                    "description": "Enable automatic cleanup of language server processes on extension exit/deactivate (disabled by default)."
                },
                "teroshdl.cleanup.killServerProcesses.gracePeriodMs": {
                    "type": "number",
                    "default": 500,
                    "minimum": 0,
                    "description": "Grace period in milliseconds between SIGTERM and SIGKILL when killing language server processes."
                }
            }
        }

@qarlosalberto
Copy link
Contributor

qarlosalberto commented Dec 14, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to control the number of cores the langugage server spawns? vhdl_ls processes remain open even after closing VSCode

2 participants