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:
parent
2089d71ed2
commit
e2c775a89d
4
main.go
4
main.go
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user