httpie / cli

🥧 HTTPie CLI — modern, user-friendly command-line HTTP client for the API era. JSON support, colors, sessions, downloads, plugins & more.
https://httpie.io
BSD 3-Clause "New" or "Revised" License
33.37k stars 3.67k forks source link

Hangs on Git Bash #612

Closed decadence closed 6 years ago

decadence commented 6 years ago

httpie is working ok on Windows cmd but just hangs on Git Bash. Though http without args finds command. screenshot_1 screenshot_2 screenshot_3

decadence commented 6 years ago

This thread related https://github.com/jakubroztocil/httpie/issues/445 But --ignore-stdin doesn't output headers.

jwedel commented 6 years ago

Same issue here...

jkbrzt commented 6 years ago

This is, unfortunately, a bug in Git Bash. It makes Python think that both stdin and stdout are redirected. And since HTTPie changes its behaviour when data is piped in/out, it causes these issues.

As a workaround, you can try change the default_options in your config.json to ignore stdin redirection and make HTTPie behave for redirected stdout similarly to the default mode :

{
    // […]
    "default_options": [
        "--ignore-stdin",
        "--print=hb", 
        "--pretty=all"
    ],
}

(To see the location of the config file, run http --debug and look for config_dir.)

You can always un-set or change options specified in config.json for individual invocations:

https://httpie.org/doc#un-setting-previously-specified-options

See the docs for more details about how piping changes HTTPie's behaviour:

https://httpie.org/doc#redirected-input https://httpie.org/doc#redirected-output