peterh/liner

Paste input not displayed after #81 was fixed

tsandall opened this issue · 3 comments

Hello! First of all, thanks for making a great library. I've been happily building a REPL on top of it for a little while now.

Description

Recently, I noticed an issue when pasting text containing newlines into the REPL. Specifically, liner doesn't display the pasted text, however, it seems that liner has received the text and passed it to the REPL.

I only noticed this after recently updating to the tip of master. I manually bisected the history and found that the behaviour changed with 2d7c636 (which fixed #81).

Steps to reproduce

It may be a bit tricky to reproduce this bug in isolation. The key (in my case) seems to be pasting text containing newlines. If the text doesn't contain a newline, it displays fine.

I can offer you a working example (on Mac):

torin:~$ cat >test <<EOF
> p :- true
> EOF
torin:~$ pbcopy < test
torin:~$ docker run -it --rm openpolicyagent/opa:0.2.1
OPA 0.2.1 (commit b3f62a1, built at 2016-11-23T16:33:13Z)

Run 'help' to see a list of commands.

> p :- true
>

Note: the paste happens on the first non-empty line after "Run 'help' to see [...]", i.e., "> p :- true".

When I do the same with openpolicyagent/opa:0.2.2, I only see an empty line:

torin:~$ docker run -it --rm openpolicyagent/opa:0.2.2
OPA 0.2.2 (commit fb9e6c7, built at 2016-12-01T01:41:03Z)

Run 'help' to see a list of commands.

>
>

In v0.2.1 OPA is using 8975875 and in v0.2.2 OPA is using 3c5f577. This is what I get for not pinning dependencies with Glide.

Additional Info

  • Operating System: Mac, but also noticed issue while running on Linux/Docker for Mac
  • Terminal Emulator: iTerm2

Sorry for the slow reply. I was away when your bug report came in, and I forgot about it when I got back.

I wasn't able to reproduce this bug, but I think I see how it happens. I just pushed a change that should fix it. Could you please test bf27d3b and let me know? Thanks.

Updated to bf27d3b and did not see the problem. LGTM.

Great! Thanks for testing.