Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paste input not displayed after #81 was fixed #86

Closed
tsandall opened this issue Jan 17, 2017 · 3 comments
Closed

Paste input not displayed after #81 was fixed #86

tsandall opened this issue Jan 17, 2017 · 3 comments

Comments

@tsandall
Copy link

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
tsandall added a commit to tsandall/opa that referenced this issue Jan 18, 2017
tsandall added a commit to open-policy-agent/opa that referenced this issue Jan 18, 2017
peterh added a commit that referenced this issue Feb 11, 2017
@peterh
Copy link
Owner

peterh commented Feb 11, 2017

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.

@tsandall
Copy link
Author

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

@peterh
Copy link
Owner

peterh commented Feb 12, 2017

Great! Thanks for testing.

@peterh peterh closed this as completed Feb 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants