Turned off Ctrl+C processing by Windows shell

Signed-off-by: Brendan Dixon <brendand@microsoft.com>
This commit is contained in:
Brendan Dixon 2015-04-10 15:43:35 -07:00
parent 34332b8151
commit a15746e7cf
3 changed files with 25 additions and 5 deletions

View file

@ -1,6 +1,7 @@
package winconsole
import (
"fmt"
"io"
"strconv"
"strings"
@ -206,6 +207,21 @@ func (c *ansiCommand) getParam(index int) string {
return ""
}
func (ac *ansiCommand) String() string {
return fmt.Sprintf("0x%v \"%v\" (\"%v\")",
bytesToHex(ac.CommandBytes),
ac.Command,
strings.Join(ac.Parameters, "\",\""))
}
func bytesToHex(b []byte) string {
hex := make([]string, len(b))
for i, ch := range b {
hex[i] = fmt.Sprintf("%X", ch)
}
return strings.Join(hex, "")
}
func parseInt16OrDefault(s string, defaultValue int16) (n int16, err error) {
if s == "" {
return defaultValue, nil