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

read is still line-buffered when a delimiter is specified #783

Closed
Crestwave opened this issue Jul 8, 2020 · 7 comments
Closed

read is still line-buffered when a delimiter is specified #783

Crestwave opened this issue Jul 8, 2020 · 7 comments

Comments

@Crestwave
Copy link
Contributor

Crestwave commented Jul 8, 2020

I'm honestly having trouble reproducing this in a non-interactive script (if you can, do let me know how!), but you can simply run read -d a and press a. In Bash, read will immediately exit, but on OSH, it still waits for a newline. This is required to run pxltrm

@andychu
Copy link
Contributor

andychu commented Jul 8, 2020

Ah good point, right now we do something special for read -n 3 but not read -d a. It should be easy to make it apply to read whenever it's a terminal

andychu pushed a commit that referenced this issue Jul 18, 2020
So that 'read -d a' returns after the first 'a'.

Addresses issue #783.
@andychu
Copy link
Contributor

andychu commented Jul 18, 2020

@Crestwave This is on master now if you want to try it out. Sorry I forgot about it for the 0.8.pre8 release last night

@Crestwave
Copy link
Contributor Author

Great; I've gotten pxltrm to run now! Here's my rough patch. Essentially, it's #262, eval_unsafe_arith,read -p, and ${arr}.

@andychu
Copy link
Contributor

andychu commented Jul 21, 2020

OK nice! read -p sounds easy enough to add to minimize the patch

The other changes look good

@andychu
Copy link
Contributor

andychu commented Jul 22, 2020

I did a basic version of read -p ... If it doesn't allow you to remove the patches let me know :)

@Crestwave
Copy link
Contributor Author

Okay, it seems to work, although the patch isn't much smaller because I found some more uses of $_ that account for some edge cases. I've opened a pull request: dylanaraps/pxltrm#18

@andychu
Copy link
Contributor

andychu commented Aug 10, 2020

@andychu andychu closed this as completed Aug 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants