repl: Improve iopub connection error messages (#53014)

MostlyK created

Coming from #51834, these would be more helpful than just that it
failed!

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable


Release Notes:

- N/A

Change summary

crates/repl/src/kernels/ssh_kernel.rs | 2 +-
crates/repl/src/kernels/wsl_kernel.rs | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)

Detailed changes

crates/repl/src/kernels/ssh_kernel.rs 🔗

@@ -215,7 +215,7 @@ impl SshRunningKernel {
                 &session_id,
             )
             .await
-            .context("failed to create iopub connection")?;
+            .context("Failed to create iopub connection. Is `ipykernel` installed in the remote environment? Try running `pip install ipykernel` on the remote host.")?;
 
             let peer_identity = runtimelib::peer_identity_for_session(&session_id)?;
             let shell_socket = runtimelib::create_client_shell_connection_with_identity(

crates/repl/src/kernels/wsl_kernel.rs 🔗

@@ -354,7 +354,8 @@ impl WslRunningKernel {
                 "",
                 &session_id,
             )
-            .await?;
+            .await
+            .context("Failed to create iopub connection. Is `ipykernel` installed in the WSL environment? Try running `pip install ipykernel` inside your WSL distribution.")?;
 
             let peer_identity = runtimelib::peer_identity_for_session(&session_id)?;
             let shell_socket = runtimelib::create_client_shell_connection_with_identity(