httpie / http-prompt

An interactive command-line HTTP and API testing client built on top of HTTPie featuring autocomplete, syntax highlighting, and more. https://twitter.com/httpie
https://http-prompt.com
MIT License
8.96k stars 326 forks source link

Support for piping into scripts that use escape codes #174

Open katmfoo opened 4 years ago

katmfoo commented 4 years ago

I have a shell script called yank (source) that you can pipe data into and it will copy it to the system clipboard using escape code osc 52. I would love to use this with http-prompt, so that I could do the following:

get | yank

and have the output of the request copied to my clipboard. Normally (when the yank script is ran in just a normal shell) there is no output of any text, as the shell recognizes the escape codes and simply does the action (copying to clipboard in this case) instead of outputting the text. http-prompt seems to just dump out the text though, and the resulting action does not happen. Here is an image of what happens:

image

Ideally, http-prompt should not output any of the text and allow the escape codes to be read by the shell to perform the action.