fix: ws查看内容cat命令移除showTabs,按下 Ctrl+C补充回车

This commit is contained in:
TsMask
2024-08-09 18:46:45 +08:00
parent a5c88369fb
commit bbdfb52478
2 changed files with 2 additions and 7 deletions

View File

@@ -154,8 +154,7 @@ func (s *WSReceiveImpl) ShellView(client *model.WSClient, reqMsg model.WSRequest
case "close":
s.close(client)
return
case "cat":
case "tail":
case "cat", "tail":
var command string
if reqMsg.Type == "cat" {
command, err = processor.ParseCat(reqMsg.Data)
@@ -170,7 +169,7 @@ func (s *WSReceiveImpl) ShellView(client *model.WSClient, reqMsg model.WSRequest
case "ctrl-c":
// 模拟按下 Ctrl+C
sshClientSession := client.ChildConn.(*ssh.SSHClientSession)
_, err = sshClientSession.Write("\x03")
_, err = sshClientSession.Write("\u0003\n")
case "resize":
// 会话窗口重置
msgByte, _ := json.Marshal(reqMsg.Data)