peterh/liner

Liner does not print characters when shift is pressed

Opened this issue · 1 comments

Operating System

Windows 11

Terminal Emulator

  • Integrated terminal in VSCode
  • Integrated terminal in GoLand

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

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.