Repository navigation
Conversation
Fixes Kuddev#512 When a shell fails to start (e.g., uninstalled WSL distro or missing PowerShell), the terminal pane would silently disappear because the existing logic could not distinguish startup failures from normal exits. The shell_started flag was defined in view.rs and its state machine was already implemented (set to true on first Wakeup event, checked in mark_exited to emit either Exited or StartupFailed event), but the constructor in startup.rs missed the initialization. This commit adds the missing initialization (shell_started: false) so the state machine works as designed: failed shells now trigger StartupFailed events that preserve the pane and show an error toast instead of silently closing.
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.
修复 #512
问题
当 shell 启动失败时(例如卸载了 WSL 发行版或 PowerShell 缺失),终端窗格会静默消失,因为现有逻辑无法区分启动失败和正常退出。
解决方案
shell_started标志已经在view.rs中定义,其状态机逻辑也已完整实现:Wakeup事件时置为true(shell 产生了输出)mark_exited中检查该标志,决定发出Exited还是StartupFailed事件StartupFailed事件处理器保留窗格并显示错误提示但是
startup.rs中的构造函数遗漏了初始化,导致标志始终未初始化。本 PR 添加了缺失的初始化(
shell_started: false),让状态机按设计工作。测试
架构检查器通过。格式检查器显示整个代码库已存在的 CRLF 问题(非本次改动引入)。