console: don't exit on ctrl-c, only on ctrl-d #21660 (#1531)

* add interrupt counter

* remove interrupt counter, allow ctrl-C to clear ONLY, ctrl-D will terminate console, stop node

* format

* add instructions to exit

* fix tests

Co-authored-by: rene <41963722+renaynay@users.noreply.github.com>
This commit is contained in:
Daniel Liu 2025-09-24 07:46:25 +08:00 committed by GitHub
parent 473b22bd55
commit db0cd1581f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 0 deletions

View file

@ -66,6 +66,7 @@ at block: 0 ({{niltime}})
datadir: {{.Datadir}}
modules: {{apis}}
To exit, press ctrl-d
> {{.InputLine "exit"}}
`)
XDC.ExpectExit()
@ -155,6 +156,7 @@ at block: 0 ({{niltime}}){{if ipc}}
datadir: {{datadir}}{{end}}
modules: {{apis}}
To exit, press ctrl-d
> {{.InputLine "exit" }}
`)
attach.ExpectExit()

View file

@ -320,6 +320,7 @@ func (c *Console) Welcome() {
sort.Strings(modules)
message += " modules: " + strings.Join(modules, " ") + "\n"
}
message += "\nTo exit, press ctrl-d"
fmt.Fprintln(c.printer, message)
}