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
Smoother behaviour when composing with other-language programs #178
Comments
The root of the problem is that you're not supposed to use Also, your use of
... and Your final line should basically be this: proc "git" (["add", "-p"] ++ argv) empty |
The point of the example is that sometimes the inner program reads from stdin, and sometimes it doesn't. In the specific case of Thanks for the point about |
Actually, forgot even about the wrapper program I mentioned, the original example already demonstrates the issue: |
Before I continue, let me address your original points 3 and 4 which I forgot to respond to. For point 3, For point 4, I'm working on So part of this discussion is whether or not there should be a I'd prefer not to add a
I agree with you that if you provide If that's okay with you, that's what I will fix. |
Sounds good, and I can see that Another idea to avoid passing in |
Alright, this should be fixed now. |
Great, thanks! |
You're welcome! |
Small example, run this inside a git repo (with unstaged/uncommited changes):
stdin
explicitly, it should be implicit if not given.proc'
or something like that.stdin
explicitly, it doesn't work well if i run e.g../git-add-p.hs nonexistentfile
- git will output "No changes" and exit, but Turtle only exits if I ctrl-D explicitly. Or, I press [enter] instead, then it exits with an uglygit-add-p.hs: fd:12: hClose: resource vanished (Broken pipe)
.empty
everywhere when usingproc
.pack
.getArgs
to Turtle that appliesfmap (fmap pack)
.git add -p
flushes the buffer on non-line breaks (when prompting for user input), so when you run./git-add-p.hs
the behaviour is not the best. You can see similar issues when replacingadd
withlog
and it triggers the pager. But I can understand if supporting this is low priority; I wanted mainly to demonstrate the other points.I'm still a haskell noob so apologies if any of this is redundant / doable with other utils.
The text was updated successfully, but these errors were encountered: