mirror of
https://github.com/wavetermdev/waveterm.git
synced 2024-12-22 16:48:23 +01:00
return username with init packet
This commit is contained in:
parent
0a6d8b8e9f
commit
315a048f49
@ -10,6 +10,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"os/signal"
|
||||
"os/user"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
@ -171,6 +172,9 @@ func doMain() {
|
||||
initPacket.Env = os.Environ()
|
||||
initPacket.HomeDir = homeDir
|
||||
initPacket.ScHomeDir = scHomeDir
|
||||
if user, _ := user.Current(); user != nil {
|
||||
initPacket.User = user.Username
|
||||
}
|
||||
sender.SendPacket(initPacket)
|
||||
for pk := range packetCh {
|
||||
if pk.GetType() == packet.PingPacketStr {
|
||||
|
@ -235,6 +235,7 @@ type RunnerInitPacketType struct {
|
||||
ScHomeDir string `json:"schomedir"`
|
||||
HomeDir string `json:"homedir"`
|
||||
Env []string `json:"env"`
|
||||
User string `json:"user"`
|
||||
}
|
||||
|
||||
func (*RunnerInitPacketType) GetType() string {
|
||||
|
Loading…
Reference in New Issue
Block a user