2
2
mirror of https://github.com/Hilbis/Hilbish synced 2025-04-02 19:53:23 +00:00

fix: print newline on ctrlc

This commit is contained in:
sammy 2021-04-16 10:27:11 -04:00
parent 2089d71ed2
commit e2c775a89d
No known key found for this signature in database
GPG Key ID: 50EE40A2809851F5

View File

@ -98,8 +98,10 @@ func main() {
for {
running = false
hl.SetPrompt(fmtPrompt())
input, err := hl.Read()
if err == io.EOF {
// Exit if user presses ^D (ctrl + d)
fmt.Println("")
@ -111,7 +113,7 @@ func main() {
}
input = strings.TrimSpace(input)
if len(input) == 0 { continue }
if len(input) == 0 { fmt.Print("\n"); continue }
if strings.HasSuffix(input, "\\") {
for {