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

Unexpected behavior on certain inputs #196

Closed
dav-s opened this issue Jun 23, 2017 · 5 comments
Closed

Unexpected behavior on certain inputs #196

dav-s opened this issue Jun 23, 2017 · 5 comments

Comments

@dav-s
Copy link

dav-s commented Jun 23, 2017

I recently started playing around with pick (1.6.1) and it's fantastic! I discovered some weird behavior while messing around with it.

Here is an example: pick -h | pick. Running this initially results in a blank screen but as characters are inputted, the current string is duplicated until it reaches the top of the screen.

Piping in pick -h is probably not a typical use case, but the behavior that results is strange.

EDIT: I am running macOS 10.12.5, if this helps at all.

@dav-s
Copy link
Author

dav-s commented Jun 23, 2017

This might be related to issue #98 ?

@calleluks
Copy link
Collaborator

Hey @EpicDavi, thanks for trying out pick. I'm happy you like it!

When running pick -h | pick from the shell, the stdout stream of pick -h will be connected to the stdin stream of pick. Since pick -h outputs the usage message to stderr rather than to stdout, this passes no results to pick. That should explain the black screen you see.

To exit pick you can press Ctrl-C. When you do, you should see the usage message that pick -h printed to your terminal (which was attached to its stderr). You can also type something while pick is running and press Alt-Enter to have pick output that when exiting.

as characters are inputted, the current string is duplicated until it reaches the top of the screen.

Could you elaborate on this? Maybe upload a screen recording? This does sound like a bug but I can't reproduce it on macOS 10.12.5 running pick from bash in Terminal. Are you running a different shell or terminal emulator?

@dav-s
Copy link
Author

dav-s commented Jun 24, 2017

Just tried it on another machine (macOs 10.12) and am having the same issue.

However, I tried it on the built-in Terminal (instead of iTerm2) and the issue no longer occurs. This makes me think it is an issue with iTerm2 (3.0.15)?

Anyways, here is what the issue looks like, if you are curious: https://asciinema.org/a/xqJPG5vAVHkkIvNdblbiOuKDJ

@mptre
Copy link
Owner

mptre commented Jun 25, 2017

Thanks for the report, I'm able to reproduce this using xterm(1):

$ pick </dev/null

Please try out #198 and see if it solves the problem.

mptre added a commit that referenced this issue Jun 25, 2017
mptre added a commit that referenced this issue Jun 26, 2017
@mptre
Copy link
Owner

mptre commented Jun 26, 2017

Fix has been merged, closing for now.

@mptre mptre closed this as completed Jun 26, 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

3 participants