fix(terminal): start a root login shell

Launch Web terminal sessions in /root as login shells so they load the root profile and display the configured prompt.
This commit is contained in:
watermeko
2026-09-04 02:49:05 +00:00
committed by Guoguo
parent 283c1390e5
commit 5c0bef019f

View File

@@ -41,7 +41,8 @@ func (s *Service) Terminal(c *gin.Context) {
_ = ws.Close()
}()
cmd := exec.Command("/bin/sh")
cmd := exec.Command("/bin/sh", "-l")
cmd.Dir = "/root"
ptmx, err := pty.Start(cmd)
if err != nil {
log.Errorf("failed to start pty: %s", err)