fix: Add command to reconnecting PTY (#1860)

This fixes #1708 and opens the door for PTYs to execute
non-shell commands!
This commit is contained in:
Kyle Carberry
2022-05-27 14:51:20 -05:00
committed by GitHub
parent 6052607936
commit d0ed107b08
4 changed files with 10 additions and 8 deletions

View File

@ -221,7 +221,7 @@ func TestAgent(t *testing.T) {
conn := setupAgent(t, agent.Metadata{}, 0)
id := uuid.NewString()
netConn, err := conn.ReconnectingPTY(id, 100, 100)
netConn, err := conn.ReconnectingPTY(id, 100, 100, "/bin/bash")
require.NoError(t, err)
bufRead := bufio.NewReader(netConn)
@ -259,7 +259,7 @@ func TestAgent(t *testing.T) {
expectLine(matchEchoOutput)
_ = netConn.Close()
netConn, err = conn.ReconnectingPTY(id, 100, 100)
netConn, err = conn.ReconnectingPTY(id, 100, 100, "/bin/bash")
require.NoError(t, err)
bufRead = bufio.NewReader(netConn)