cmd/geth, jsre: restore command line editing on windows

PR #856 broke command line editing by wrapping stdout with a filter that
interprets ANSI escape sequences to fix colored printing on windows.
Implement the printer in Go instead so it can do its own
platform-dependent coloring.

As a nice side effect, the JS console is now noticeably more responsive
when printing results.

Fixes #1608
Fixes #1612
This commit is contained in:
Felix Lange
2015-08-11 17:14:46 +01:00
parent 05c66529b2
commit 0ef80bb3d0
27 changed files with 1941 additions and 872 deletions

View File

@ -103,19 +103,14 @@ func TestNatto(t *testing.T) {
func TestBind(t *testing.T) {
jsre := New("")
defer jsre.Stop(false)
jsre.Bind("no", &testNativeObjectBinding{})
val, err := jsre.Run(`no.TestMethod("testMsg")`)
_, err := jsre.Run(`no.TestMethod("testMsg")`)
if err != nil {
t.Errorf("expected no error, got %v", err)
}
pp, err := jsre.PrettyPrint(val)
if err != nil {
t.Errorf("expected no error, got %v", err)
}
t.Logf("no: %v", pp)
jsre.Stop(false)
}
func TestLoadScript(t *testing.T) {
@ -139,4 +134,4 @@ func TestLoadScript(t *testing.T) {
t.Errorf("expected '%v', got '%v'", exp, got)
}
jsre.Stop(false)
}
}