Fix input

This commit is contained in:
Tobias P.L Wennberg 2025-01-12 13:54:02 +01:00
parent 6a94165e54
commit b127f92566

View File

@ -85,6 +85,7 @@ func input_str(env *environment.Env) string {
}
switch r_rune {
case 3: // ^C
fmt.Println("^C")
input = ""
case 4: // ^D
input = "exit"
@ -95,10 +96,11 @@ func input_str(env *environment.Env) string {
input = env.History[history_index]
}
case 66: // DOWN
if history_index < len(env.History)-1 {
if history_index < len(env.History)-2 {
history_index++
input = env.History[history_index]
} else {
history_index = len(env.History)-1
input = ""
}
case 67: // LEFT