Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Argument list too long; env multiplies with windows #163

Closed
skjbulcher opened this issue Jun 13, 2024 · 6 comments
Closed

Argument list too long; env multiplies with windows #163

skjbulcher opened this issue Jun 13, 2024 · 6 comments
Labels
upstream Upstream issue

Comments

@skjbulcher
Copy link

skjbulcher commented Jun 13, 2024

I have an issue that I am trying to troubleshoot:

Failed to start LSP-copilot - disabling for this window for the duration of the current session.
Re-enable by running "LSP: Enable Language Server In Project" from the Command Palette.

--- Error:---
[Errno 7] Argument list too long: '/home/[myuser]/.cache/sublime-text/Package Storage/lsp_utils/node-runtime/18.18.1/node/bin/node'

This issue most frequently occurs when I open a Sublime Text new window. However, it does occasionally occur in code windows as well. Today I had to find and click on the error quite a few times in order to access Sublime Text, which is a problem.

While I was searching around for ways to troubleshoot the issue, I discovered this when running LSP: Troubleshoot Server:
339439009-7f20b679-54c1-457f-9cc7-33e737355b1f

Note that I keep a lot of windows and tabs open in Sublime Text from time to time.

Running "LSP: Dump Window Configs" yielded this result for env:

env={'PATH': '/home/[myuser]/.cache/sublime-text/Package Storage/lsp_utils/node-runtime/18.18.1/node/bin:/home/[myuser]/.cache/sublime-text/Package Storage/lsp_utils/node-runtime/18.18.1/node/bin:/home/[myuser]/.cache/sublime-text/Package Storage/lsp_utils/node-runtime/18.18.1/node/bin:/home/[myuser]/.cache/sublime-text/Package Storage/lsp_utils/node-runtime/18.18.1/node/bin:/home/[myuser]/.cache/sublime-text/Package Storage/lsp_utils/node-runtime/18.18.1/node/bin:/home/[myuser]/.cache/sublime-text/Package Storage/lsp_utils/node-runtime/18.18.1/node/bin:'}

Depending on the window, the env is repeated more or less. I suspect that each window appends to the env, without any duplication.

I don't know if the "argument list too long" issue has anything to do with the environment, but even if it isn't the env could be handled better.

@TerminalFi
Copy link
Owner

Can you open Sublime Text in safe mode and then open the console and run

import os; print(os.environ["PATH"])

@jfcherng
Copy link
Collaborator

And could you just run LSP: Troubleshoot Server for LSP-copilot and paste the result here?

@jfcherng
Copy link
Collaborator

jfcherng commented Jun 13, 2024

I have found the culprit is in lsp_utils. I will file a PR there soon.

Note that I keep a lot of windows

This triggers the bug.

@jfcherng jfcherng added the upstream Upstream issue label Jun 13, 2024
jfcherng added a commit to jfcherng-sublime/ST-dep-lsp_utils that referenced this issue Jun 13, 2024
… starts

Fixes TerminalFi/LSP-copilot#163

Signed-off-by: Jack Cherng <jfcherng@gmail.com>
@skjbulcher
Copy link
Author

Can you open Sublime Text in safe mode and then open the console and run

import os; print(os.environ["PATH"])
>>> import os; print(os.environ["PATH"])
/home/[USERNAME]/google-cloud-sdk/bin:/home/[USERNAME]/.nvm/versions/node/v21.6.2/bin:/home/[USERNAME]/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/[USERNAME]/.local/bin

@skjbulcher
Copy link
Author

And could you just run LSP: Troubleshoot Server for LSP-copilot and paste the result here?

Troubleshooting: LSP-copilot

Version

  • LSP: 2.1.0
  • Sublime Text: 4169

Server Test Run

  • exit code: 0
  • output

Server Configuration

  • command
[
  "${node_bin}",
  "${server_path}",
  "--stdio"
]
  • shell command
"/home/[USERNAME]/.cache/sublime-text/Package Storage/lsp_utils/node-runtime/18.18.1/node/bin/node" "/home/[USERNAME]/.cache/sublime-text/Package Storage/LSP-copilot/18.18.1/language-server/node_modules/copilot-node-server/copilot/dist/language-server.js" --stdio
  • selector
source | text | embedding
  • priority_selector
source | text | embedding
  • init_options
{}
  • settings
{
  "auto_ask_completions": true,
  "commit_completion_on_tab": true,
  "completion_style": "popup",
  "debug": false,
  "hook_to_auto_complete_command": false,
  "local_checks": false,
  "proxy": "",
  "telemetry": false
}
  • env
{
  "PATH": "/home/[USERNAME]/.cache/sublime-text/Package Storage/lsp_utils/node-runtime/18.18.1/node/bin:/home/[USERNAME]/.cache/sublime-text/Package Storage/lsp_utils/node-runtime/18.18.1/node/bin:/home/[USERNAME]/.cache/sublime-text/Package Storage/lsp_utils/node-runtime/18.18.1/node/bin:/home/[USERNAME]/.cache/sublime-text/Package Storage/lsp_utils/node-runtime/18.18.1/node/bin:/home/[USERNAME]/.cache/sublime-text/Package Storage/lsp_utils/node-runtime/18.18.1/node/bin:/home/[USERNAME]/.cache/sublime-text/Package Storage/lsp_utils/node-runtime/18.18.1/node/bin:/home/[USERNAME]/.cache/sublime-text/Package Storage/lsp_utils/node-runtime/18.18.1/node/bin:/home/[USERNAME]/.cache/sublime-text/Package Storage/lsp_utils/node-runtime/18.18.1/node/bin:/home/[USERNAME]/.cache/sublime-text/Package Storage/lsp_utils/node-runtime/18.18.1/node/bin:/home/[USERNAME]/.cache/sublime-text/Package Storage/lsp_utils/node-runtime/18.18.1/node/bin:/home/[USERNAME]/.cache/sublime-text/Package Storage/lsp_utils/node-runtime/18.18.1/node/bin:/home/[USERNAME]/.cache/sublime-text/Package Storage/lsp_utils/node-runtime/18.18.1/node/bin:/home/[USERNAME]/.cache/sublime-text/Package Storage/lsp_utils/node-runtime/18.18.1/node/bin:/home/[USERNAME]/.cache/sublime-text/Package Storage/lsp_utils/node-runtime/18.18.1/node/bin:/home/[USERNAME]/.cache/sublime-text/Package Storage/lsp_utils/node-runtime/18.18.1/node/bin:/home/[USERNAME]/.cache/sublime-text/Package Storage/lsp_utils/node-runtime/18.18.1/node/bin:"
}

Active view

  • File name
None
  • Settings
{
  "auto_complete_selector": null,
  "lsp_active": null,
  "syntax": null
}

Project / Workspace

  • folders
[]
  • is project: False

LSP configuration

{}

System PATH

  • /home/[USERNAME]/.local/bin
  • /usr/local/sbin
  • /usr/local/bin
  • /usr/sbin
  • /usr/bin
  • /sbin
  • /bin
  • /usr/games
  • /usr/local/games
  • /snap/bin

@jfcherng
Copy link
Collaborator

jfcherng commented Jun 14, 2024

The upstream has merged the fix so we just have to wait for its new release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream Upstream issue
Projects
None yet
Development

No branches or pull requests

3 participants