diff --git a/CHANGELOG.md b/CHANGELOG.md index d80fc2e88..18a38f334 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ - `switch` now allows arguments that expand to nothing, like empty variables (#5677). - The null command (`:`) now always exits successfully, rather than passing through the previous exit status (#6022). - `jobs --last` returns 0 to indicate success when a job is found (#6104). +- `commandline -p` and `commandline -j` now split on `&&` and `||` in addition to `;` and `&` (#6214) ### Syntax changes and new commands - Brace expansion now only takes place if the braces include a "," or a variable expansion, meaning common commands such as `git reset HEAD@{0}` do not require escaping (#5869). diff --git a/src/parse_util.cpp b/src/parse_util.cpp index a3c9e2616..842d1cc59 100644 --- a/src/parse_util.cpp +++ b/src/parse_util.cpp @@ -323,12 +323,14 @@ static void job_or_process_extent(const wchar_t *buff, size_t cursor_pos, const } /* FALLTHROUGH */ case token_type_t::end: - case token_type_t::background: { + case token_type_t::background: + case token_type_t::andand: + case token_type_t::oror: { if (tok_begin >= pos) { finished = 1; if (b) *b = (wchar_t *)begin + tok_begin; } else { - if (a) *a = (wchar_t *)begin + tok_begin + 1; + if (a) *a = (wchar_t *)begin + tok_begin + token->length; } break; }