fix(terminal): resolve PTY shell exec error, simplify CLI, unify Config tabs, restore Studio CSS
- Fix detectShell() to return full paths via LookPath (was returning bare names causing exec error on some systems) - Add shell path validation before pty.Start to prevent crashes - Simplify CLI: remove all subcommands, keep only desktop launch with --port - Restore missing Studio shared CSS (code blocks, input area, animations) - Replace Config vertical sidebar with horizontal nav-tabs matching main layout 💘 Generated with Crush Assisted-by: GLM-5.1 via Crush <crush@charm.land>
This commit is contained in:
@@ -82,10 +82,19 @@ func (s *Server) handleTerminalWS(w http.ResponseWriter, r *http.Request) {
|
||||
shell := initMsg.Data
|
||||
if shell == "" {
|
||||
shell = detectShell()
|
||||
} else {
|
||||
if path, err := exec.LookPath(shell); err == nil {
|
||||
shell = path
|
||||
}
|
||||
}
|
||||
|
||||
if _, err := os.Stat(shell); err != nil {
|
||||
conn.WriteJSON(wsMessage{Type: "error", Data: fmt.Sprintf("shell not found: %s", shell)})
|
||||
return
|
||||
}
|
||||
|
||||
if strings.Contains(shell, "wsl") {
|
||||
cmd = exec.Command("wsl", "--shell-type", "login")
|
||||
cmd = exec.Command(shell, "--shell-type", "login")
|
||||
} else if strings.Contains(shell, "powershell") || strings.Contains(shell, "pwsh") {
|
||||
cmd = exec.Command(shell, "-NoLogo", "-NoProfile")
|
||||
} else {
|
||||
@@ -250,8 +259,8 @@ func (s *Server) handleTerminalSessionsDelete(w http.ResponseWriter, r *http.Req
|
||||
func detectShell() string {
|
||||
shells := []string{"zsh", "bash", "fish", "pwsh", "powershell"}
|
||||
for _, s := range shells {
|
||||
if _, err := exec.LookPath(s); err == nil {
|
||||
return s
|
||||
if path, err := exec.LookPath(s); err == nil {
|
||||
return path
|
||||
}
|
||||
}
|
||||
return "/bin/sh"
|
||||
|
||||
Reference in New Issue
Block a user