revert-54069ad305 #11

Closed
bagas wants to merge 217 commits from revert-54069ad305 into main
Showing only changes of commit 990bccbff7 - Show all commits
+8 -1
View File
@@ -44,6 +44,7 @@ type Forwarder interface {
}
type Interaction struct {
InputLength int
CommandBuffer *bytes.Buffer
EditMode bool
EditSlug string
@@ -96,13 +97,18 @@ func (i *Interaction) HandleUserInput() {
i.SendMessage(string(buf[:n]))
if char == 8 || char == 127 {
if i.InputLength > 0 {
//i.CommandBuffer.Truncate(i.CommandBuffer.Len() - 1)
i.SendMessage("\b \b")
}
if i.CommandBuffer.Len() > 0 {
i.CommandBuffer.Truncate(i.CommandBuffer.Len() - 1)
i.SendMessage("\b \b")
}
continue
}
i.InputLength += n
if char == '/' {
i.CommandBuffer.Reset()
i.CommandBuffer.WriteByte(char)
@@ -111,6 +117,7 @@ func (i *Interaction) HandleUserInput() {
if i.CommandBuffer.Len() > 0 {
if char == 13 {
i.SendMessage("\033[K")
i.HandleCommand(i.CommandBuffer.String())
continue
}