From f1e97cdbcc13318cb3de39d9e67bc0241614dfcc Mon Sep 17 00:00:00 2001 From: Sebastien Douheret Date: Fri, 9 Mar 2018 15:57:36 +0100 Subject: Improved PtyMode (eows lib). - renamed PtsMode to PtyMode - used byte array instead of string - allowed terminal echo on/off (PtyMode only) - fixed support escaped and control characters (PtyMode only) Signed-off-by: Sebastien Douheret --- golib/eows/eows-in.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'golib/eows/eows-in.go') diff --git a/golib/eows/eows-in.go b/golib/eows/eows-in.go index 89ca891..5e74c76 100644 --- a/golib/eows/eows-in.go +++ b/golib/eows/eows-in.go @@ -13,21 +13,21 @@ type DoneChan struct { err error } -// cmdPumpStdin is in charge of receive characters and send them to stdin -func (e *ExecOverWS) cmdPumpStdin(inw *os.File) { +// pumpStdin is in charge of receive characters and send them to stdin +func (e *ExecOverWS) pumpStdin(inw *os.File) { done := make(chan DoneChan, 1) if e.InputEvent != "" && e.InputCB != nil { - err := (*e.SocketIO).On(e.InputEvent, func(stdin string) { - in, err := e.InputCB(e, string(stdin)) + err := (*e.SocketIO).On(e.InputEvent, func(stdin []byte) { + in, err := e.InputCB(e, stdin) if err != nil { e.logDebug("Error stdin: %s", err.Error()) inw.Close() return } - if _, err := inw.Write([]byte(in)); err != nil { + if _, err := inw.Write(in); err != nil { e.logError("Error while writing to stdin: %s", err.Error()) } }) -- cgit 1.2.3-korg