Fixes a bug mentioned in https://github.com/zed-industries/zed/issues/38891 Release Notes: - Fixed a bug where environment variables like `NODE_EXTRA_CA_CERTS` were not loaded from the user's shell initialization scripts in WSL or SSH remote projects.
Unified · Split
| @@ -6,7 +6,7 @@ use util::ResultExt; · 5 unmodified lines | |||
| 6 | 6 | ||
| 7 | use extension::ExtensionHostProxy; | 7 | use extension::ExtensionHostProxy; |
| 8 | use fs::{Fs, RealFs}; | 8 | use fs::{Fs, RealFs}; |
| 9 | use futures::channel::mpsc; | 9 | use futures::channel::{mpsc, oneshot}; |
| 10 | use futures::{AsyncRead, AsyncWrite, AsyncWriteExt, FutureExt, SinkExt, select, select_biased}; | 10 | use futures::{AsyncRead, AsyncWrite, AsyncWriteExt, FutureExt, SinkExt, select, select_biased}; |
| 11 | use git::GitHostingProviderRegistry; | 11 | use git::GitHostingProviderRegistry; |
| 12 | use gpui::{App, AppContext as _, Context, Entity, SemanticVersion, UpdateGlobal as _}; | 12 | use gpui::{App, AppContext as _, Context, Entity, SemanticVersion, UpdateGlobal as _}; |
| @@ -368,6 +368,14 @@ pub fn execute_run( · 355 unmodified lines | |||
| 368 | 368 | ||
| 369 | let listeners = ServerListeners::new(stdin_socket, stdout_socket, stderr_socket)?; | 369 | let listeners = ServerListeners::new(stdin_socket, stdout_socket, stderr_socket)?; |
| 370 | 370 | ||
| 371 | let (shell_env_loaded_tx, shell_env_loaded_rx) = oneshot::channel(); | ||
| 372 | app.background_executor() | ||
| 373 | .spawn(async { | ||
| 374 | util::load_login_shell_environment().await.log_err(); | ||
| 375 | shell_env_loaded_tx.send(()).ok(); | ||
| 376 | }) | ||
| 377 | .detach(); | ||
| 378 | |||
| 371 | let git_hosting_provider_registry = Arc::new(GitHostingProviderRegistry::new()); | 379 | let git_hosting_provider_registry = Arc::new(GitHostingProviderRegistry::new()); |
| 372 | app.run(move |cx| { | 380 | app.run(move |cx| { |
| 373 | settings::init(cx); | 381 | settings::init(cx); |
| @@ -413,7 +421,11 @@ pub fn execute_run( · 39 unmodified lines | |||
| 413 | ) | 421 | ) |
| 414 | }; | 422 | }; |
| 415 | 423 | ||
| 416 | let node_runtime = NodeRuntime::new(http_client.clone(), None, node_settings_rx); | 424 | let node_runtime = NodeRuntime::new( |
| 425 | http_client.clone(), | ||
| 426 | Some(shell_env_loaded_rx), | ||
| 427 | node_settings_rx, | ||
| 428 | ); | ||
| 417 | 429 | ||
| 418 | let mut languages = LanguageRegistry::new(cx.background_executor().clone()); | 430 | let mut languages = LanguageRegistry::new(cx.background_executor().clone()); |
| 419 | languages.set_language_server_download_dir(paths::languages_dir().clone()); | 431 | languages.set_language_server_download_dir(paths::languages_dir().clone()); |