Repository navigation
Description
Found while testing #1870, though not caused by it; collected in #1943.
Summary
Several templates start their language server with sh -c <command> <argument>, for example the TypeScript template's sh -c typescript-language-server --stdio. LSP4IJ splits the command at spaces, so sh gets -c, typescript-language-server and --stdio as separate arguments. sh -c only runs the first one; the rest become $0, $1, … of that command, so the language server starts without --stdio:
$ sh -c 'echo "$0=$0 args=[$*]"' --stdio
$0=--stdio args=[]It mostly goes unnoticed, as the installers of these templates replace the command ("update": true) the first time a file opens. Until then, or without the installer, the command is broken.
The Ruby LSP installer has the same problem: sh -c gem install ruby-lsp only runs gem, which prints its help and exits with 1. Quoting doesn't help there, since ExecTaskFactory splits a string command with split(" "), without regard to quotes.
The two Ruby templates are worse off: they use sh -s instead of sh -c. With -s, sh reads its commands from stdin, so the Ruby LSP template never starts ruby-lsp and feeds the LSP messages to sh instead, and the Ruby Debug installer waits for commands on stdin instead of installing (see below).
Affected
typescript-language-server,stylelint-lsp,gopls,harper-ls,perl-lsp,sysml-lsp,eo-lsp-server:template.json,programArgs.defaultruby-lsp:installer.json,run.exec.command.defaultruby-lsp:template.json,programArgs.defaultissh -s ruby-lsp, which is worse, see belowruby-rdbg(debug adapter):installer.json,run.exec.command.defaultissh -s gem install debug, see belowgoplsloses-mode=stdio, but talks over stdio without it too.rust-analyzerandwgsl-analyzeruse the same form, but without arguments, so nothing is lost there.vscode-html-language-serverquotes it right (sh -c "node '…' --stdio"), so it works, but doesn't needsh -ceither.- The first example in the template docs shows the same
sh -c typescript-language-server --stdio, copied from the TypeScript template in #1934, so it needs the same fix.
The TypeScript template had sh -c \"typescript-language-server --stdio\" with quotes until 335daf8 ("Exec task improve", #1082, June 2025); the others took the form over later. Was there a reason to drop the quotes, maybe the installer splitting strings only at spaces (see below)?
sh -s in the Ruby templates
With -s, sh reads its commands from stdin, and the other arguments only become $1, $2, …:
$ echo 'echo "ran from stdin, $1=$1"' | sh -s ruby-lsp
ran from stdin, $1=ruby-lsp
$ printf 'Content-Length: 52\r\n\r\n{"jsonrpc":"2.0","id":0,"method":"initialize"}' | sh -s ruby-lsp
sh: line 1: Content-Length:: command not found
sh: line 2: : command not found
sh: line 3: jsonrpc:2.0: command not found- The Ruby LSP template starts
sh -s ruby-lsp:ruby-lspnever runs, andshtakes the LSP messages on stdin for shell code. - The Ruby Debug installer runs
sh -s gem install debug:shwaits for commands on stdin.ExecTaskruns it with aCapturingProcessHandlerand no timeout, and doesn't close stdin, so it likely waits until it's cancelled. With an empty stdin, it would exit with 0 without installing anything. - The Ruby LSP installer's check runs the start command,
sh -s ruby-lsp, with a 2 s timeout, andExecTaskcounts a timeout as success, so the check passes although nothing is installed, and Install if Needed never installs it (see the next section and Installer check: a hanging command counts as installed #1957).
Both came with f6c7ea63 ("feat: add ruby-lsp") and 335daf8; -s was likely meant to be -c. Without a shell, ruby-lsp and gem install debug would do.
The installer check counts a timeout as success
The Ruby LSP check only passes because ExecTask counts a command that is still running after its 2 s timeout as success, and Install if Needed then skips the install. That affects 20 installers, not only Ruby, and is about the installer code rather than the templates, so it's #1957 now, with ideas for a reliable check.
Is sh -c needed?
I don't think so. sh -c is a non-interactive, non-login shell: it reads no configuration (no .zprofile, .zshrc or .bash_profile) and only passes on the PATH it gets. That PATH comes from LSP4IJ: createCommandLine and ExecTask pass EnvironmentUtil.getEnvironmentMap(): the environment IntelliJ loads from the user's login shell when it starts from the Dock or Finder, or the terminal's when it starts from one. GeneralCommandLine looks the command up on that same PATH, so typescript-language-server --stdio finds the same program as sh -c "typescript-language-server --stdio". With a working directory, LSP4IJ looks the command up in the PATH of that directory's environment, e.g. from mise or direnv, as the user guide describes since #1693 and #1894; sh -c doesn't change that either.
The habit may come from the user guide itself, which says: "Depending on your OS, the environment variables may not be accessible. To make sure they are accessible", use cmd /c command_to_start_your_ls on Windows and sh -c command_to_start_your_ls on Linux and macOS. As above, sh -c doesn't load any environment of its own; it only passes on what it gets.
On macOS, /bin/sh is bash 3.2 in POSIX mode, and it keeps the PATH it's given:
$ env -i PATH=/usr/bin:/bin /bin/sh -c 'echo $PATH'
/usr/bin:/bin
$ env -i PATH=/usr/bin:/bin HOME=$HOME /bin/zsh -lc 'echo $PATH'
/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:…:/usr/bin:/bin:…sh -c would only matter for shell syntax (&&, pipes, ~, globs), which none of these commands use (${BASE_DIR} and ${workingDir} are resolved by LSP4IJ itself). A login shell ($SHELL -l -c) would read .zprofile again, which the IDE already did, and an interactive one can print to stdout on start, which breaks a server talking over stdio.
Suggested fix
- Change the user guide's advice to use
sh -corcmd /cfor the environment variables: say where the environment comes from (EnvironmentUtil, the directory's environment, the variables configured in the settings), and use a shell only for shell syntax, with the whole command quoted. - Drop
sh -candsh -sfrom these commands, e.g."default": "typescript-language-server --stdio","default": "ruby-lsp","default": "gem install ruby-lsp"and"default": "gem install debug". Then they look like the other templates, and the mistake can't come back. Change the example in the template docs the same way. - Quoting, as the HTML template does, would work in
template.json, but not for a string ininstaller.json(see above), and leaves the trap open for the next template, so I'd rather not. - Split string commands in
ExecTaskFactorywithCommandUtils.createCommandstoo, so templates and installers split the same way. - If a template ever needs shell syntax, a flag such as
"shell": truecould let LSP4IJ wrap the whole command as["/bin/sh", "-c", command](orcmd /Con Windows), so nobody has to get the quoting right by hand.
Other findings in the templates
Besides sh -c and sh -s, the inventory below shows a few things that might be issues of their own:
- jq-lsp: the installer sets the command to
jq-lsp -mode=stdio, a gopls option that jq-lsp rejects, so the server doesn't start after installing; that's jq-lsp template: the installer sets an option jq-lsp rejects #1956 now. jdtls:(done in fix: small template and installer bugs from #1959, #1960, #1961 and #1947 #1981)-configuration "~/.cache/jdtls"relies on a shell to expand~; without one, the path is taken as it is. The installer's command uses$USER_HOME$instead. Whether${user.name}in the Windows command gets resolved hasn't been checked.erlang-ls: the installer checks(done in fix: small template and installer bugs from #1959, #1960, #1961 and #1947 #1981)which erlang, but the Erlang binary is usuallyerl.- Windows: some templates call
cmd /C x.cmd, others justx.cmd, and the installers' commands usex.cmd. With a working directory, LSP4IJ looks a command up with the extensions inPATHEXT(user guide, since feat: support directory environment variables #1693), sonpxfindsnpx.cmd; whethercmd /Cis still needed for a.cmdhasn't been tried on Windows. - Placeholders such as
XXX,path/to/your/…and<<insert base directory>>in the commands: see Templates: placeholders in commands aren't recognized #1959. - Install folders and ids that don't match across templates: see Templates: install folders and commands don't always match #1960.
- Versions that are fixed or go stale: see Installers: keep download versions current #1961.
Inventory of all templates
All start and install commands at main 42b4e25d (2026-11-09), with the problems found. The installer check ${server.command} runs the start command. Where a template has commands per system, others is its default.
Language servers (33)
ada_language_server
- Files on main:
template.json,installer.json - Start:
- Windows:
"${BASE_DIR}/ada_language_server.exe" - others:
"${BASE_DIR}/ada_language_server"
- Windows:
- Install: downloads the server
- Command after install:
${output.dir}/${output.file.name}
astro-ls
- Problem: On Windows, the start command runs
astro-ls.cmddirectly, while the TypeScript, Stylelint, EO and Candor templates wrap their.cmdincmd /C. The templates disagree on whether a.cmdneeds it; which is right hasn't been tried on Windows. - Files on main:
template.json,installer.json - Start:
- Windows:
astro-ls.cmd --stdio - others:
astro-ls --stdio
- Windows:
- Installer check:
${server.command} - Install:
- Windows:
npm.cmd install @astrojs/language-server prettier-plugin-astro typescript --force - others:
npm install @astrojs/language-server prettier-plugin-astro typescript --force
- Windows:
- Command after install:
- Windows:
${workingDir}/.bin/astro-ls.cmd --stdio - others:
${workingDir}/.bin/astro-ls --stdio
- Windows:
camel-lsp-server
- Problem: The start command
java -jar camel-lsp-server-XXX.jarhas the placeholderXXXfor the version, so it can't work before the installer has run. The installer finds the latest version on Maven Central itself. See Templates: placeholders in commands aren't recognized #1959. - Files on main:
template.json,installer.json - Start:
java -jar camel-lsp-server-XXX.jar - Install: downloads the server
- Command after install:
java -jar ${output.dir}/${output.file.name}
candor-lsp
- Files on main:
template.json,installer.json - Start:
- Windows:
cmd /C candor-lsp.cmd - others:
candor-lsp
- Windows:
- Installer check:
${server.command} - Install:
- Windows:
npm.cmd install candor-ts --force - others:
npm install candor-ts --force
- Windows:
- Command after install:
- Windows:
${workingDir}/.bin/candor-lsp.cmd - others:
${workingDir}/.bin/candor-lsp
- Windows:
clangd
- Problem: It unpacks into
~/.lsp4ij/lspitself, not into a folder of its own like the other installers. See Templates: install folders and commands don't always match #1960. - Problem: It fetches prereleases (
"prerelease": true), i.e. the weekly snapshots, not the latest stable release. See Installers: keep download versions current #1961. Problem: The fallback URL for macOS starts with a space ((done in fix: small template and installer bugs from #1959, #1960, #1961 and #1947 #1981)" https://…"), so it fails when it's needed. See Installers: keep download versions current #1961.- Files on main:
template.json,installer.json - Start:
clangd - Install: downloads the server
- Command after install:
${output.dir}/${output.file.name}
clojure-lsp
- Files on main:
template.json,installer.json - Start:
- Windows:
"${BASE_DIR}/clojure-lsp.exe" - others:
"${BASE_DIR}/clojure-lsp.sh"
- Windows:
- Install: downloads the server
- Command after install:
${output.dir}/${output.file.name}
dart-lsp
- Files on main:
template.json,installer.json - Start:
dart language-server - Installer check:
${server.command} - Command after install:
dart language-server
docker-language-server
- Files on main:
template.json,installer.json - Start:
docker-language-server start --stdio - Install: downloads the server
- Command after install:
${output.dir}/${output.file.name} start --stdio
eo-lsp-server
- Problem: The start command
sh -c eo-lsp-server --stdiois split at spaces, sosh -conly runseo-lsp-server, and--stdiobecomes$0instead of reaching the server. The installer replaces the command with one withoutsh -c, so this only shows before the installer has run, or without it. - Files on main:
template.json,installer.json - Start:
- Windows:
cmd /C eo-lsp-server.cmd --stdio - others:
sh -c eo-lsp-server --stdio
- Windows:
- Installer check:
${server.command} - Install:
- Windows:
npm.cmd install eo-lsp-server --force - others:
npm install eo-lsp-server --force
- Windows:
- Command after install:
- Windows:
${workingDir}/.bin/eo-lsp-server.cmd --stdio - others:
${workingDir}/.bin/eo-lsp-server --stdio
- Windows:
erlang-ls
Problem: The installer checks(done in fix: small template and installer bugs from #1959, #1960, #1961 and #1947 #1981)which erlang(where erlangon Windows), but Erlang's program is usuallyerl, so the check likely fails even with Erlang installed.Problem: The template starts(done in fix: small template and installer bugs from #1959, #1960, #1961 and #1947 #1981)escript $PROJECT_DIR$/erlang_ls, from the project, while the installer puts it into~/.lsp4ij/lsp/erlang/erlang_ls. See Templates: install folders and commands don't always match #1960.- Files on main:
template.json,installer.json - Start:
escript $PROJECT_DIR$/erlang_ls - Installer check:
- Windows:
where erlang - others:
which erlang
- Windows:
- Install: downloads the server
- Command after install:
escript ${output.dir}/${output.file.name}
gopls
- Problem: The start command
sh -c gopls -mode=stdiois split at spaces, sosh -conly runsgopls, and-mode=stdiobecomes$0instead of reaching the server. The installer replaces the command with one withoutsh -c, so this only shows before the installer has run, or without it. gopls talks over stdio without it too, so it still works. - Files on main:
template.json,installer.json - Start:
- Windows:
gopls -mode=stdio - others:
sh -c gopls -mode=stdio
- Windows:
- Installer check:
${server.command} - Install:
go install golang.org/x/tools/gopls@latest - Command after install:
gopls -mode=stdio
harper-ls
- Problem: The start command
sh -c ${BASE_DIR}/harper-ls --stdiois split at spaces, sosh -conly runs${BASE_DIR}/harper-ls, and--stdiobecomes$0instead of reaching the server. The installer replaces the command with one withoutsh -c, so this only shows before the installer has run, or without it. - Files on main:
template.json,installer.json - Start:
- Windows:
${BASE_DIR}/harper-ls.exe --stdio - others:
sh -c ${BASE_DIR}/harper-ls --stdio
- Windows:
- Install: downloads the server
- Command after install:
${output.dir}/${output.file.name} --stdio
jdtls
Problem: The start command has(done in fix: small template and installer bugs from #1959, #1960, #1961 and #1947 #1981)-configuration "~/.cache/jdtls". Without a shell,~isn't expanded, so the path is taken as it is. The installer's command uses$USER_HOME$instead.Problem: Template and installer put the data elsewhere:(done in fix: small template and installer bugs from #1959, #1960, #1961 and #1947 #1981)$DATA_DIRin the template,$PROJECT_DIR$/jdtls-data, inside the project, in the installer. See Templates: install folders and commands don't always match #1960.- Problem: It installs into
~/.lsp4ij/lsp/jdt-ls, after its template idjdt-ls, while the template folder isjdtls. See Templates: install folders and commands don't always match #1960. Problem: Whether(done in fix: small template and installer bugs from #1959, #1960, #1961 and #1947 #1981)${user.name}in the Windows command gets resolved hasn't been checked.- Files on main:
template.json,installer.json - Start:
- Windows:
"${BASE_DIR}/bin/jdtls.bat" -configuration "C:/Users/${user.name}/.cache/jdtls" -data "$DATA_DIR" - others:
"${BASE_DIR}/bin/jdtls" -configuration "~/.cache/jdtls" -data "$DATA_DIR"
- Windows:
- Install: downloads the server
- Command after install:
"${output.dir}/${output.file.name}" -configuration "$USER_HOME$/.cache/jdtls" -data "$PROJECT_DIR$/jdtls-data"
jq-lsp
- Problem: After installing, the installer sets the command to
jq-lsp -mode=stdio, a gopls option. jq-lsp stops on unknown options ("Unknown option"), so the server exits right away. See jq-lsp template: the installer sets an option jq-lsp rejects #1956. - Problem: The installer's hint text still says "the Go Language Server (
gopls)". See jq-lsp template: the installer sets an option jq-lsp rejects #1956. - Files on main:
template.json,installer.json - Start:
jq-lsp - Installer check:
${server.command} - Install:
go install github.com/wader/jq-lsp@latest - Command after install:
jq-lsp -mode=stdio
julia
- Note: The debug adapter for Julia has the same id,
julia. - Files on main:
template.json - Start:
julia -e "using LanguageServer; runserver()" - No installer
lemminx
- Note:
"runtime": "java": LSP4IJ adds the Java runtime, so the command only holds the Java arguments. - Files on main:
template.json - Start:
-classpath "${BASE_DIR}/org.eclipse.lemminx-uber.jar" org.eclipse.lemminx.XMLServerLauncher - No installer
luau-lsp
Problem: The start command has the placeholders(done in fix: small template and installer bugs from #1959, #1960, #1961 and #1947 #1981)path/to/your/…for the program and for--definitionsand--docs. See Templates: placeholders in commands aren't recognized #1959.Problem: The installer only fills in the program: its command still has(done in fix: small template and installer bugs from #1959, #1960, #1961 and #1947 #1981)--definitions=path/to/your/…and--docs=path/to/your/…, so the server doesn't start after installing either. Both options are optional. See Templates: placeholders in commands aren't recognized #1959.- Files on main:
template.json,installer.json - Start:
- Windows:
path/to/your/luau-lsp.exe lsp --definitions=path/to/your/globalTypes.d.luau --docs=path/to/your/rb-docs.json - others:
path/to/your/luau-lsp lsp --definitions=path/to/your/globalTypes.d.luau --docs=path/to/your/rb-docs.json
- Windows:
- Install: downloads the server
- Command after install:
${output.dir}/${output.file.name} lsp --definitions=path/to/your/globalTypes.d.luau --docs=path/to/your/rb-docs.json
metals
- Files on main:
template.json,installer.json - Start:
- Windows:
"$USER_HOME$/.lsp4ij/lsp/metals/metals.bat" - others:
"$USER_HOME$/.lsp4ij/lsp/metals/metals"
- Windows:
- Installer check:
${server.command} - Install:
cs install metals --install-dir . - Command after install:
- Windows:
${workingDir}/metals.bat - others:
${workingDir}/metals
- Windows:
perl-lsp
- Problem: The start command
sh -c ${BASE_DIR}/perllsp --stdiois split at spaces, sosh -conly runs${BASE_DIR}/perllsp, and--stdiobecomes$0instead of reaching the server. The installer replaces the command with one withoutsh -c, so this only shows before the installer has run, or without it. - Files on main:
template.json,installer.json - Start:
- Windows:
${BASE_DIR}/perllsp.exe --stdio - others:
sh -c ${BASE_DIR}/perllsp --stdio
- Windows:
- Install: downloads the server
- Command after install:
${output.dir}/${output.file.name} --stdio
ruby-lsp
- Problem: The start command is
sh -s ruby-lsp. With-s,shreads its commands from stdin, i.e. the LSP messages, soruby-lspnever runs. - Problem: The installer check runs that command; it hangs until the 2 s timeout, which counts as success, so Install if Needed doesn't install anything. See Installer check: a hanging command counts as installed #1957.
- Problem: The install runs
sh -c gem install ruby-lsp, which only runsgem(it prints its help and exits with 1). - Files on main:
template.json,installer.json - Start:
- Windows:
cmd /C ruby-lsp - others:
sh -s ruby-lsp
- Windows:
- Installer check:
${server.command} - Install:
- Windows:
cmd /C gem install ruby-lsp - others:
sh -c gem install ruby-lsp
- Windows:
rust-analyzer
- Problem: The start command wraps
${BASE_DIR}/rust-analyzerinsh -c. Without arguments nothing is lost, butsh -cisn't needed: the program is found without a shell. - Files on main:
template.json,installer.json - Start:
- Windows:
${BASE_DIR}/rust-analyzer.exe - others:
sh -c ${BASE_DIR}/rust-analyzer
- Windows:
- Install: downloads the server
- Command after install:
${output.dir}/${output.file.name}
sdl-lsp
- Problem: The start command
java -jar XXX-jar-with-dependencies.jarhas the placeholderXXX, so it can't work before the installer has run. See Templates: placeholders in commands aren't recognized #1959. - Problem: It downloads into the project,
$PROJECT_DIR$/.sdlb, while the example in the template docs uses~/.lsp4ij/lsp/sdl-lsp. See Templates: install folders and commands don't always match #1960. - Files on main:
template.json,installer.json - Start:
java -jar XXX-jar-with-dependencies.jar - Installer check:
${server.command} - Install: downloads the server
- Command after install:
java -jar ${output.dir}/${output.file.name}
sourcekit-lsp
- Files on main:
template.json,installer.json - Start:
sourcekit-lsp - Installer check:
${server.command} - Command after install:
sourcekit-lsp
stylelint-lsp
- Problem: The start command
sh -c stylelint-lsp --stdiois split at spaces, sosh -conly runsstylelint-lsp, and--stdiobecomes$0instead of reaching the server. The installer replaces the command with one withoutsh -c, so this only shows before the installer has run, or without it. - Files on main:
template.json,installer.json - Start:
- Windows:
cmd /C stylelint-lsp.cmd --stdio - others:
sh -c stylelint-lsp --stdio
- Windows:
- Installer check:
${server.command} - Install:
- Windows:
npm.cmd install stylelint-lsp --force - others:
npm install stylelint-lsp --force
- Windows:
- Command after install:
- Windows:
${workingDir}/.bin/stylelint-lsp.cmd --stdio - others:
${workingDir}/.bin/stylelint-lsp --stdio
- Windows:
svelte-language-server
- Problem: On Windows, the start command runs
svelteserver.cmddirectly, while the TypeScript, Stylelint, EO and Candor templates wrap their.cmdincmd /C. The templates disagree on whether a.cmdneeds it; which is right hasn't been tried on Windows. - Files on main:
template.json,installer.json - Start:
- Windows:
svelteserver.cmd --stdio - others:
svelteserver --stdio
- Windows:
- Installer check:
${server.command} - Install:
- Windows:
npm.cmd install svelte-language-server --force - others:
npm install svelte-language-server --force
- Windows:
- Command after install:
- Windows:
${workingDir}/.bin/svelteserver.cmd --stdio - others:
${workingDir}/.bin/svelteserver --stdio
- Windows:
sysml-lsp
- Problem: The start command
sh -c sysml-lsp --stdiois split at spaces, sosh -conly runssysml-lsp, and--stdiobecomes$0instead of reaching the server. The installer replaces the command with one withoutsh -c, so this only shows before the installer has run, or without it. - Files on main:
template.json,installer.json - Start:
- Windows:
sysml-lsp --stdio - others:
sh -c sysml-lsp --stdio
- Windows:
- Installer check:
${server.command} - Install: downloads the server
- Command after install:
${output.dir}/${output.file.name} --stdio
terraform-ls
- Problem: It downloads a fixed 0.36.5, while the other download installers fetch the latest release. See Installers: keep download versions current #1961.
- Files on main:
template.json,installer.json - Start:
- Windows:
terraform-ls.exe serve - others:
terraform-ls serve
- Windows:
- Install: downloads the server
- Command after install:
${output.dir}/${output.file.name} serve
typescript-language-server
- Problem: The start command
sh -c typescript-language-server --stdiois split at spaces, sosh -conly runstypescript-language-server, and--stdiobecomes$0instead of reaching the server. The installer replaces the command with one withoutsh -c, so this only shows before the installer has run, or without it. - Files on main:
template.json,installer.json - Start:
- Windows:
cmd /C typescript-language-server.cmd --stdio - others:
sh -c typescript-language-server --stdio
- Windows:
- Installer check:
${server.command} - Install:
- Windows:
npm.cmd install typescript-language-server typescript --force - others:
npm install typescript-language-server typescript --force
- Windows:
- Command after install:
- Windows:
${workingDir}/.bin/typescript-language-server.cmd --stdio - others:
${workingDir}/.bin/typescript-language-server --stdio
- Windows:
vscode-css-language-server
- Problem: It installs the whole
vscode-langservers-extractedpackage into its own folder, and the ESLint template does the same, so it's there twice. See Templates: install folders and commands don't always match #1960. - Files on main:
template.json,installer.json - Start:
node $USER_HOME$/.lsp4ij/lsp/vscode-css-language-server/node_modules/vscode-langservers-extracted/lib/css-language-server/node/cssServerMain.js --stdio - Installer check:
${server.command} - Install:
- Windows:
npm.cmd install vscode-langservers-extracted --force - others:
npm install vscode-langservers-extracted --force
- Windows:
- Command after install:
node ${workingDir}/vscode-langservers-extracted/lib/css-language-server/node/cssServerMain.js --stdio
vscode-eslint-language-server
- Problem: It installs the whole
vscode-langservers-extractedpackage into its own folder, and the CSS template does the same, so it's there twice. See Templates: install folders and commands don't always match #1960. - Files on main:
template.json,installer.json - Start:
node $USER_HOME$/.lsp4ij/lsp/vscode-eslint-language-server/node_modules/vscode-langservers-extracted/lib/eslint-language-server/eslintServer.js --stdio - Installer check:
${server.command} - Install:
- Windows:
npm.cmd install vscode-langservers-extracted --force - others:
npm install vscode-langservers-extracted --force
- Windows:
- Command after install:
node ${workingDir}/vscode-langservers-extracted/lib/eslint-language-server/eslintServer.js --stdio
vscode-html-language-server
- Problem: On macOS and Linux, the start command is
sh -c "node '…' --stdio". It's quoted right and works, butsh -cisn't needed:nodeis found on thePATHwithout a shell. - Problem: There's no installer; the command points to the HTML server inside a VS Code installation, although the
vscode-langservers-extractedpackage that the CSS and ESLint templates install has it too. See Templates: install folders and commands don't always match #1960. - Files on main:
template.json - Start:
- Windows:
node "$USER_HOME$/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/html-language-features/server/dist/node/htmlServerMain.js" --stdio - macOS:
sh -c "node '/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/html-language-features/server/dist/node/htmlServerMain.js' --stdio" - Linux:
sh -c "node '/usr/share/code/resources/app/extensions/html-language-features/server/dist/node/htmlServerMain.js' --stdio" - others:
sh -c "node 'resources/app/extensions/html-language-features/server/dist/node/htmlServerMain.js' --stdio"
- Windows:
- No installer
vue-js-language-server
- Problem: On Windows, the start command runs
vue-language-server.cmddirectly, while the TypeScript, Stylelint, EO and Candor templates wrap their.cmdincmd /C. The templates disagree on whether a.cmdneeds it; which is right hasn't been tried on Windows. - Problem: It installs into
~/.lsp4ij/lsp/vue-js-language-server-ls, with an extra-ls, and without thenode_modulesthe other npm installers have in theirworkingDir. See Templates: install folders and commands don't always match #1960. - Files on main:
template.json,installer.json - Start:
- Windows:
vue-language-server.cmd --stdio - others:
vue-language-server --stdio
- Windows:
- Installer check:
${server.command} - Install:
- Windows:
npm.cmd install @vue/language-server typescript --force - others:
npm install @vue/language-server typescript --force
- Windows:
- Command after install:
- Windows:
${workingDir}/node_modules/.bin/vue-language-server.cmd --stdio - others:
${workingDir}/node_modules/.bin/vue-language-server --stdio
- Windows:
wgsl-analyzer
- Problem: The start command wraps
${BASE_DIR}/wgsl-analyzerinsh -c. Without arguments nothing is lost, butsh -cisn't needed: the program is found without a shell. - Files on main:
template.json,installer.json - Start:
- Windows:
${BASE_DIR}/wgsl-analyzer.exe - others:
sh -c ${BASE_DIR}/wgsl-analyzer
- Windows:
- Install: downloads the server
- Command after install:
${output.dir}/${output.file.name}
Debug adapters (9)
buildx-dockerfile
- Files on main:
template.json - Start:
- Windows:
docker.exe buildx dap build - others:
docker buildx dap build
- Windows:
- No installer
codelldb
- Problem: The start command has the placeholder
<<insert base directory>>. The installer replaces it with its folder, but without the installer the command can't work. See Templates: placeholders in commands aren't recognized #1959. - Files on main:
template.json,installer.json - Start:
- Windows:
<<insert base directory>>/extension/adapter/codelldb.exe - others:
<<insert base directory>>/extension/adapter/codelldb
- Windows:
- Install: downloads the server
- Command after install:
${output.dir}/${output.file.name}
go-delve
- Files on main:
template.json,installer.json - Start:
dlv dap - Installer check:
${server.command} - Install:
go install github.com/go-delve/delve/cmd/dlv@latest - Command after install:
dlv dap
julia
- Note: The language server for Julia has the same id,
julia. - Files on main:
template.json - Start:
julia $PROJECT_DIR$/server.jl ${port} - No installer
perl-dap
- Problem: The start command has the placeholder
<<insert base directory>>. The installer replaces it with its folder, but without the installer the command can't work. See Templates: placeholders in commands aren't recognized #1959. - Problem: It installs into
~/.lsp4ij/dap/perl-lsp, named after the archive, not into~/.lsp4ij/dap/perl-dapafter its template id as the other installers do. It downloads the same archive as theperl-lsptemplate, so it's downloaded twice, but it doesn't overwrite it (dap/andlsp/are separate). See Templates: install folders and commands don't always match #1960. - Files on main:
template.json,installer.json - Start:
- Windows:
<<insert base directory>>/perl-dap.exe - others:
<<insert base directory>>/perl-dap
- Windows:
- Install: downloads the server
- Command after install:
${output.dir}/${output.file.name}
python-debugpy
- Files on main:
template.json,installer.json - Start: set by the user
- Installer check:
${server.command} - Install:
pip install debugpy
ruby-rdbg
- Problem: The install runs
sh -s gem install debug. With-s,shreads its commands from stdin;ExecTaskdoesn't close stdin and has no timeout for it, so it likely waits until it's cancelled instead of installing. - Files on main:
template.json,installer.json - Start: set by the user
- Installer check:
${server.command} - Install:
- Windows:
cmd /C gem install debug - others:
sh -s gem install debug
- Windows:
swift-lldb
- Files on main:
template.json - Start:
lldb-dap - No installer
vscode-js-debug
- Problem: The start command has the placeholder
<<insert base directory>>. The installer replaces it with its folder, but without the installer the command can't work. See Templates: placeholders in commands aren't recognized #1959. - Files on main:
template.json,installer.json - Start:
node <<insert base directory>>/js-debug/src/dapDebugServer.js ${port} 127.0.0.1 - Install: downloads the server
- Command after install:
node ${output.dir}/src/dapDebugServer.js ${port} 127.0.0.1
How this was checked
Tried: only how sh -c, sh -s and zsh -lc behave, on macOS. The inventory was made by Claude Code from the template files at 42b4e25; the jq-lsp option check comes from its source, not from running it. None of the affected servers was started without its installer. That the Ruby LSP installer installs nothing comes from the code and from running sh -c gem install ruby-lsp by hand (exit 1, only gem's help); the installer itself wasn't run in the IDE. That IntelliJ loads the login shell's environment when started from the Dock or Finder (EnvironmentUtil) is known IntelliJ behaviour, only seen indirectly here: the runIde sandbox logs "loading shell env is skipped: IDE has been launched from a terminal". Windows wasn't looked at: there the templates use cmd /C ….cmd, for other reasons (Java doesn't find .cmd files through PATHEXT).
Activity
muescha commentedon Nov 11, 2026
A note before anyone picks this up: the section "Is
sh -cneeded?" needs a decision from the maintainers first, since it decides what the fix looks like.Options:
typescript-language-server --stdio,ruby-lspandgem install debugin the templates and the docs example, and the user guide no longer advisessh -c/cmd /cfor the environment variables.sh -c, but quote the whole command, as before 335daf8 (Exec task improve #1082). That works intemplate.json, but ininstaller.jsononly onceExecTaskFactorysplits with quotes in mind, and each new template has to get the quoting right again."shell": trueflag for a template that really needs shell syntax, so LSP4IJ wraps the command itself (sh -corcmd /C).Open question: was there a reason to drop the quotes in 335daf8, for example the installer splitting strings only at spaces? If so, that reason would favour option 1 or 3.
Not affected by the decision, so these could go ahead right away:
sh -sis wrong either way (sh -s ruby-lspnever startsruby-lsp).ExecTaskFactorysplitting string commands withCommandUtils.createCommands, so templates and installers split the same way.muescha commentedon Nov 11, 2026
More input for the decision, from a look at the code on main (b80ec21e) by Claude Code: what happens to servers created before the fix, how a
"shell"field could handle old templates and settings, and an option 4.Servers created before the fix
A plugin update with fixed templates doesn't change servers that already exist. LSP4IJ doesn't ignore their settings, but it doesn't take anything from the new templates either. When a server is created from a template, LSP4IJ copies the command (
commandLine) and the installer JSON (installerConfigurationContent) into the settings and starts the server from that copy from then on. Of the template, onlytemplateIdis kept, and it's read in two places only:LanguageServerView.getUrl);isServerExists).So a server created with
sh -c typescript-language-server --stdiokeeps that command until the installer ("update": true) or the user replaces it, and a Ruby LSP server withsh -s ruby-lspstays broken.Where old commands live:
src/main/resources/templates/lsp,…/dap)"shell", so "as today"UserDefinedLanguageServerItemSettings)commandLineandinstallerConfigurationContentare copies, onlytemplateIdis kept"shell"field has to go into the settings too, or these always run "as today"configureServerwith"update": true,ConfigureServerTask→setCommandLine)commandLineof the settings, without a fieldDAPTemplateDeserializer, DAP settings)The servers created already are the ones affected most. Ways to deal with them, whichever option is chosen:
templateIdnames a bundled template and the saved command is exactly that template's old, broken command, replace it with the new one. A command the user changed doesn't match, so it's left alone. This needs a list "old command → new command" per template, for this one release.sh -cfollowed by more than one unquoted word, andsh -s, in the settings and on a failed start. Rewriting such commands without an exact match isn't safe:sh -c script a bwith$0/$1is valid shell and may be intended.A
"shell"field: "set → new rules, missing → as today"One way to keep old templates and settings working: if a template has
"shell": trueor"shell": false, the new rules apply; without the field, the old ones.LSP4IJ never wraps a command in a shell today, so "as today" already means "no shell, the command as written".
"shell": falsewould do exactly the same, so for starting the server, a missing field andfalseare the same; onlytruechanges something (["/bin/sh", "-c", command], or["cmd", "/C", command]on Windows).The rule matters where the old behaviour should change without breaking old templates:
ExecTaskFactorysplits a string command withsplit(" "), without regard to quotes. With the field:CommandUtils.createCommands, which respects"…", as when the server starts. Without it:split(" ")as before, so an old installer with"in a command behaves the same.sh -c a b c. Without the field, LSP4IJ could flag more than one unquoted word aftersh -c. With the field, it takes the command literally.Things to watch:
Boolean shellinUserDefinedLanguageServerItemSettings, withnullfor "as today". The pattern exists already:transportModedefaults to stdio for settings saved without one, "as they did". The New Language Server dialog takes the field from the template, andLanguageServerDefinitionSerializerwrites it on export only when it's set.falseon the first save.run.exec/check.execininstaller.json, not only onprogramArgs. The installer JSON is kept as a copy in the settings, so a field in the JSON is enough there."shell"would be both a switch ("start in a shell") and a version marker ("new splitting rules"). That works, but it needs to be documented; otherwise it's a surprise that"shell": falsechanges how the installer splits.So the rule fits and breaks nothing: anything without the field behaves as today. The bundled templates don't need the field, only the fixed command. For servers created already, the field alone doesn't help; the broken
sh -ccommands stay broken until someone changes them. A warning makes them visible, with or without the field.If no bundled template needs shell syntax after the fix, the field can wait (option 1). Then the fixed templates, the warning and
createCommandsin the installer are enough. For the installer splitting, "missing →split(" ")" no longer applies then; instead, check whether an existing installer has"in a string command. Among the bundled ones, only jdtls has"…", inconfigureServer, and that goes throughcreateCommands, not throughExecTaskFactory.Option 4: always run the command in a shell
LSP4IJ would start every command as
["/bin/sh", "-c", command], or["cmd", "/C", command]on Windows, without a field."shell": true(opt-in)sh/cmdsh -c a bsh -c "sh -c a b"loses the same arguments inside&&,~,$HOME, globs)CommandUtils, as todayshparses them, plus$,`and\inside"…"; on Windows the rules ofcmd /C(%VAR%,^,&, quotes at start and end)$PROJECT_DIR$,${workingDir},${output.dir}, paths)$(…),;or&would run; LSP4IJ would have to escape every value, forshand forcmd["npm", "install", "-g", …])/bin/sh(bash 3.2) replaces itself with a single simple command (exec, checked); fora; bora && b,shstays the parent.cmd /Calways stays the parent: stopping may end onlycmd.exeand leave the server running on Windowssh: …: command not foundinstead of a start errorPATHshgets the same environment, including the working directory's (WorkingDirectoryCommandLinethen looks upsh, andshlooks up the server in that environment)Option 4 only prevents getting the quoting of
sh -cwrong. In return, every existing server behaves differently, substituted values become shell code, and Windows gets orphaned processes and other quoting rules. To spare existing settings, option 4 would need the same "no field → no shell" rule, and then it's option 3 with a different default for new templates.Suggestion
Option 1: plain commands in the templates, a warning (or the one-time migration) for existing servers, and
CommandUtils.createCommandsinExecTaskFactory. Add a"shell": truefield only once a template needs shell syntax.The Windows points (
cmd /Cas parent, quoting) aren't tested; they come from howcmd /Cworks. The/bin/shexecbehaviour was checked on macOS.fix: start the commands of the templates without sh -c or sh -s (redh…