-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Can't launch a command line process from Qt #1196
Comments
This is super annoying. We should make this a higher priority to fix. — On Mon, May 4, 2015 at 8:16 AM, Michael Muré [email protected]
|
Might be related to #858 |
the issue here is that we count stdin as an argument unless stdin is your terminal, so in any other case, we grab it as the argument. I ran into this when i was working on the pipe command and @travisperson and I decided the best way forward was to split up the argument types into 'file arg' and a new 'stream arg' which is for stdin. This is a hard problem to solve (thus why pipe is not merged/finished yet) |
#1193 is now merged.
sgtm. semantically, cmds like "ipfs add" can check first for file args, and otherwise default to stream? |
Yeah, although it still doesnt solve the issue entirely. even with that change, we still run into the issue where we have a stream argument, and stdin is not a terminal, so we assume there is data. There needs to be a way to check whether or not there is actually data coming through stdin.. @travisperson any ideas? |
On Mon, May 04, 2015 at 04:33:53PM -0700, Jeromy Johnson wrote:
We shouldn't care if stdin is a terminal (we could have data coming in |
that doesnt solve the problem of knowing whether or not there is data coming through stdin, and whether or not you should wait for it/try to read it. |
On Mon, May 04, 2015 at 05:42:21PM -0700, Jeromy Johnson wrote:
Why not? If there are argv arguments for whatever you might might |
This should fix issue #1196 (Can't launch a command line process from Qt). The check was bad because it took stdin into account, but it really shouldn't. License: MIT Signed-off-by: Christian Couder <[email protected]>
This should be fixed as PR #1238 as been merged. |
I confirm, it works now. |
When launched from Qt with a QProcess, the command line tool wrongly detect an extra arguments and output the help text instead of running the command.
Here is the code used to launch the process: https://github.com/MichaelMure/Arbore-qt/blob/d9d755db95447bc9b618b5d141402dcefc37cde9/src/ipfs/ipfs.cpp#L75-L78
Using strace, the syscall seems to be the same when launching from Qt and when using the command line:
from Qt
from bash
The problem seems to be this line: https://github.com/ipfs/go-ipfs/blob/29c6a53e435a9ca71aaac50daa3078b531582c2e/commands/cli/parse.go#L225
When commenting this line, the launch works as expected from Qt.
The text was updated successfully, but these errors were encountered: