aboutsummaryrefslogtreecommitdiff
path: root/core.go
diff options
context:
space:
mode:
Diffstat (limited to 'core.go')
-rw-r--r--core.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/core.go b/core.go
index c3108b6..74355e5 100644
--- a/core.go
+++ b/core.go
@@ -55,10 +55,9 @@ func (c *Core) LoadFile(fname string) error {
}
// Run evaluates content of memory
-func (c *Core) Run(ctx context.Context) {
- ctx, cancel := context.WithCancel(ctx)
- c.tty = NewConsole(ctx)
+func (c *Core) Run(ctx context.Context, cancel context.CancelFunc, con Console) {
c.stop = cancel
+ c.tty = con
for {
select {
case <-ctx.Done():