diff options
| author | Haris Thohir <harisuddinthohir@gmail.com> | 2026-01-23 07:11:46 +0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-22 16:11:46 -0800 |
| commit | 31bf2df07f4e9afeba1d4600bff7051b99e099d7 (patch) | |
| tree | 869bd85f4c3fa2cf2f31e9a8234095f1f3bd9865 /crates/atuin-client/src/import | |
| parent | chore(deps): bump lukemathwalker/cargo-chef from latest-rust-1.91.1-slim-book... (diff) | |
| download | atuin-31bf2df07f4e9afeba1d4600bff7051b99e099d7.zip | |
fix: zsh import multiline issue (#2799)
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 \\`
(https://github.com/atuinsh/atuin/pull/100#issuecomment-836477081) it
also works;
there is similar PR https://github.com/atuinsh/atuin/pull/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
Diffstat (limited to 'crates/atuin-client/src/import')
| -rw-r--r-- | crates/atuin-client/src/import/zsh.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/atuin-client/src/import/zsh.rs b/crates/atuin-client/src/import/zsh.rs index b65e2608..11e2f371 100644 --- a/crates/atuin-client/src/import/zsh.rs +++ b/crates/atuin-client/src/import/zsh.rs @@ -70,7 +70,7 @@ impl Importer for Zsh { if let Some(s) = s.strip_suffix('\\') { line.push_str(s); - line.push_str("\\\n"); + line.push('\n'); } else { line.push_str(&s); let command = std::mem::take(&mut line); @@ -188,7 +188,7 @@ mod test { #[tokio::test] async fn test_parse_file() { let bytes = r": 1613322469:0;cargo install atuin -: 1613322469:10;cargo install atuin; \ +: 1613322469:10;cargo install atuin; \\ cargo update : 1613322469:10;cargo :b̷i̶t̴r̵o̴t̴ ̵i̷s̴ ̷r̶e̵a̸l̷ " |
