mirror of
https://github.com/sipeed/NanoKVM.git
synced 2026-09-11 00:22:56 -05:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user