Skip to content

zsh import multi-line fix#2390

Open
danielfleischer wants to merge 3 commits intoatuinsh:mainfrom
danielfleischer:zsh-import
Open

zsh import multi-line fix#2390
danielfleischer wants to merge 3 commits intoatuinsh:mainfrom
danielfleischer:zsh-import

Conversation

@danielfleischer
Copy link

When importing zsh history, sometimes multi-line commands end with \\ instead of \. These are not identified and ingested as-is and inserted at use time with \\. PR is about cleaning these cases. Test added.

Issue is mentioned in #98, #1555.

Checks

  • I am happy for maintainers to push small adjustments to this PR, to speed up the review cycle
  • I have checked that there are no existing pull requests for the same thing

@ellie
Copy link
Member

ellie commented May 28, 2025

Could we add a test case for the following please?

#100 (comment)

@haristhohir haristhohir mentioned this pull request Jun 20, 2025
2 tasks
ellie pushed a commit that referenced this pull request Jan 23, 2026
Here is my case:
```sh
curl -X POST https://example.com/api \
  -H "Content-Type: application/json" \
  -d '{
    "username": "name",
    "password": "pass",
    "details": {
      "age": 30,
      "location": "Earth"
    }
  }'
```

Using current release version i got:
```sh
curl -X POST https://example.com/api \\
  -H "Content-Type: application/json" \\
  -d '{\
    "username": "name",\
    "password": "pass",\
    "details": {\
      "age": 30,\
      "location": "Earth"\
    }\
  }'
```

and i test with `echo \\`
(#100 (comment)) it
also works;

there is similar PR #2390, it only
works on multiline with `\` suffix, in my case i got:
```sh
curl -X POST https://example.com/api \
  -H "Content-Type: application/json" \
  -d '{\
```

## Checks
- [x] I am happy for maintainers to push small adjustments to this PR,
to speed up the review cycle
- [ ] I have checked that there are no existing pull requests for the
same thing
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.

2 participants