mirror of https://github.com/Hilbis/Hilbish
fix: print newline on ctrlc
parent
2089d71ed2
commit
e2c775a89d
4
main.go
4
main.go
|
@ -98,8 +98,10 @@ func main() {
|
||||||
|
|
||||||
for {
|
for {
|
||||||
running = false
|
running = false
|
||||||
|
|
||||||
hl.SetPrompt(fmtPrompt())
|
hl.SetPrompt(fmtPrompt())
|
||||||
input, err := hl.Read()
|
input, err := hl.Read()
|
||||||
|
|
||||||
if err == io.EOF {
|
if err == io.EOF {
|
||||||
// Exit if user presses ^D (ctrl + d)
|
// Exit if user presses ^D (ctrl + d)
|
||||||
fmt.Println("")
|
fmt.Println("")
|
||||||
|
@ -111,7 +113,7 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
input = strings.TrimSpace(input)
|
input = strings.TrimSpace(input)
|
||||||
if len(input) == 0 { continue }
|
if len(input) == 0 { fmt.Print("\n"); continue }
|
||||||
|
|
||||||
if strings.HasSuffix(input, "\\") {
|
if strings.HasSuffix(input, "\\") {
|
||||||
for {
|
for {
|
||||||
|
|
Loading…
Reference in New Issue