From 31bf2df07f4e9afeba1d4600bff7051b99e099d7 Mon Sep 17 00:00:00 2001 From: Haris Thohir Date: Fri, 23 Jan 2026 07:11:46 +0700 Subject: 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 --- crates/atuin-client/src/import/zsh.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates') 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̷ " -- cgit v1.3.1