Konstigt fel med pil ned blir [B
This commit is contained in:
parent
ec6ddb4a7e
commit
6d83e1b5bf
@ -100,28 +100,24 @@ func input_str(env *environment.Env) string {
|
||||
if r, _, _ := reader.ReadRune(); r != 91 {
|
||||
break
|
||||
}
|
||||
case 66: // DOWN
|
||||
if history_index < len(env.History)-2 {
|
||||
history_index++
|
||||
input = env.History[history_index]
|
||||
} else {
|
||||
history_index = len(env.History)-1
|
||||
input = ""
|
||||
if r, _, _ := reader.ReadRune(); r == 65 { // UPP
|
||||
if history_index > 0 {
|
||||
history_index--
|
||||
input = env.History[history_index]
|
||||
}
|
||||
}
|
||||
if r, _, _ := reader.ReadRune(); r != 66 { //DOWN
|
||||
if history_index < len(env.History)-1 {
|
||||
history_index++
|
||||
input = env.History[history_index]
|
||||
} else {
|
||||
input = ""
|
||||
}
|
||||
if r, _, _ := reader.ReadRune(); r == 65 { // UPP
|
||||
if history_index > 0 {
|
||||
history_index--
|
||||
input = env.History[history_index]
|
||||
}
|
||||
break
|
||||
|
||||
}
|
||||
if r, _, _ := reader.ReadRune(); r != 66 { //DOWN
|
||||
if history_index < len(env.History)-1 {
|
||||
history_index++
|
||||
input = env.History[history_index]
|
||||
} else {
|
||||
input = ""
|
||||
}
|
||||
break
|
||||
}
|
||||
|
||||
case 127: //packspace
|
||||
if len(input) > 0 {
|
||||
input = input[:len(input)-1]
|
||||
@ -132,10 +128,12 @@ func input_str(env *environment.Env) string {
|
||||
input = input + string(r_rune)
|
||||
}
|
||||
env.History[len(env.History)-1] = input
|
||||
//fmt.Println(r_rune)
|
||||
fmt.Print("\r\033[K")
|
||||
fmt.Print(env.Path)
|
||||
fmt.Print(" > ")
|
||||
fmt.Print(input)
|
||||
fmt.Print(r_rune)
|
||||
}
|
||||
loop_exit:
|
||||
term.Restore(int(std_fd), term_restore)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user