peterh / liner

Pure Go line editor with history, inspired by linenoise
MIT License
1.05k stars 132 forks source link

Liner does not print characters when shift is pressed #163

Open elgopher opened 1 year ago

elgopher commented 1 year ago

Operating System

Windows 11

Terminal Emulator

Bug behaviour

Liner does not print characters when shift is pressed.

Write following characters in sequence: a (left arrow key) B

Liner prints: a

Expected behaviour

Liner should print Ba

Complete sample that reproduces the bug

package main

import (
    "fmt"

    "github.com/peterh/liner"
)

func main() {
    l := liner.NewLiner()
    line, err := l.Prompt("> ")
    if err != nil {
        panic(err)
    }

    fmt.Println(line)
}

Run the code from VScode or GoLand, then write in terminal a (left arrow key) B

elgopher commented 1 year ago

I created a fork with a small change and it looks like the fix solved the problem, altough I am not sure I didn't broke something else.