Skip to content

Commit

Permalink
Inherit parent environment in subprocesses
Browse files Browse the repository at this point in the history
This ensures that the language servers inherit the parent environment,
retaining access to essential system variables while allowing for
specific overrides.
  • Loading branch information
hovsater committed May 10, 2024
1 parent 68c7031 commit b639eee
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugin/core/transports.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ def create_transport(config: TransportConfig, cwd: str | None,

def start_subprocess() -> subprocess.Popen:
startupinfo = _fixup_startup_args(config.command)
return _start_subprocess(config.command, stdin, stdout, subprocess.PIPE, startupinfo, config.env, cwd)
env = {**os.environ, **config.env}
return _start_subprocess(config.command, stdin, stdout, subprocess.PIPE, startupinfo, env, cwd)

if config.listener_socket:
assert isinstance(config.tcp_port, int) and config.tcp_port > 0
Expand Down

0 comments on commit b639eee

Please sign in to comment.