feat(terminal): selectable embedded shells + resilient PTY reader#4
Merged
Conversation
Embedded PTY previously hardcoded the platform default shell (cmd.exe on Windows) and the reader thread died on any read error, freezing chatty processes like `next start` on Windows ConPTY. - Reader thread retries transient errors (Interrupted/WouldBlock), only ends on EOF/BrokenPipe. Fixes log streaming cutting out on Windows. - terminal_list_shells detects cmd/powershell/pwsh/git-bash/wsl (Windows) and zsh/bash/fish (unix); terminal_spawn takes a shell arg. - Persist preferred_shell in KubeconfigSettings; settings_set merges so one field no longer clobbers the other. Shell picker in the dock + a preference selector in kubeconfig settings. - Bump portable-pty 0.8 -> 0.9 for Windows ConPTY read fixes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problema (Windows)
next start) inunda logs. El reader thread moría en cualquier error deread().cmd.exe(default_shell()). No había forma de elegir/detectar git-bash, powershell, pwsh ni wsl.Cambios
Bug 1 — reader thread resiliente
terminal_cmd.rs: el loop ya no rompe en cualquierErr. ReintentaInterrupted/WouldBlock, termina solo en EOF/BrokenPipe/UnexpectedEof. Errores desconocidos → sleep + retry en vez de teardown.Bug 2 — shells embebidos seleccionables
terminal_list_shells: detectacmd/powershell/pwsh/git-bash/wsl(Windows),zsh/bash/fish(unix). git-bash sonda PATH +Git\bin\bash.exe.terminal_spawnacepta argshell;shell_command(id)mapea a(program, args)con fallback a default.preferred_shellenKubeconfigSettings(#[serde(default)], retrocompatible).kubeconfig_settings_sethace merge — actualizar un campo no pisa el otro.auto.Hardening
portable-pty0.8 → 0.9 (arreglos ConPTY Windows). API compatible, sin cambios de código.Verificación
cargo check -p knock-app✓cargo test -p knock-core(settings_roundtrip, excluded_from_list) ✓vite build(tsc) ✓ · tests frontend ✓cfg(windows)solo compilan en Windows — verificado a mano (gating dewhich_win/env vars correcto). Falta prueba en Windows real: elegir PowerShell/git-bash/wsl y confirmar arranque + streaming denext start.