Skip to content

fix(cli): Respect --no-edit with piped stdin and no query#864

Merged
JeanMertz merged 2 commits into
mainfrom
no-edit
Jul 9, 2026
Merged

fix(cli): Respect --no-edit with piped stdin and no query#864
JeanMertz merged 2 commits into
mainfrom
no-edit

Conversation

@JeanMertz

Copy link
Copy Markdown
Collaborator

jp query --no-edit skipped the flag whenever stdin was piped without an inline query argument: the editor still opened even though the user explicitly asked to suppress it. The check for --no-edit only ran when the request body was still empty, so piped stdin content (which fills the request) bypassed it.

edit_message now also omits the editor when --no-edit is set, regardless of whether piped stdin already produced a non-empty request. Piping content and passing --no-edit now reliably skips the editor, e.g. echo "hi" | jp query --no-edit.

JeanMertz added 2 commits July 9, 2026 20:15
`jp query --no-edit` skipped the flag whenever stdin was piped
without an inline query argument: the editor still opened even
though the user explicitly asked to suppress it. The check for
`--no-edit` only ran when the request body was still empty, so
piped stdin content (which fills the request) bypassed it.

`edit_message` now also omits the editor when `--no-edit` is set,
regardless of whether piped stdin already produced a non-empty
request. Piping content and passing `--no-edit` now reliably skips
the editor, e.g. `echo "hi" | jp query --no-edit`.

Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
@JeanMertz JeanMertz merged commit 4deb5aa into main Jul 9, 2026
26 of 29 checks passed
@JeanMertz JeanMertz deleted the no-edit branch July 9, 2026 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant