Steps to reproduce
-
Run
obsidian create path="Inbox/cli-escape-repro.md" content="# CLI escape repro" overwrite. -
Run
obsidian append path="Inbox/cli-escape-repro.md" content='plain nu: \nu'. -
Run
obsidian read path="Inbox/cli-escape-repro.md". -
Observe the written note content.
Did you follow the troubleshooting guide? [Y/N]
N
I have reproduced the issue from the CLI, but this draft still uses my normal vault state rather than restricted mode or the Sandbox vault.
Expected result
The note should contain the exact literal text plain nu: \nu, with the backslash preserved.
Actual result
The CLI appears to interpret \n as a newline inside content= values, even when the shell argument is single-quoted. The resulting note is corrupted and becomes:
plain nu:
u
Environment
SYSTEM INFO:
Obsidian version: 1.12.7
Installer version: 1.12.7
Operating system: Darwin Kernel Version 25.4.0: Thu Mar 19 19:33:09 PDT 2026; root:xnu-12377.101.15~1/RELEASE_ARM64_T8112 25.4.0
Login status: logged in
Language: en
Catalyst license: none
Insider build toggle: off
Live preview: on
Base theme: adapt to system
Community theme: none
Snippets enabled: 0
Restricted mode: off
Plugins installed: 3
Plugins enabled: 3
1: Latex Suite v1.11.0
2: TikZJax v0.5.2
3: Git v2.38.0
RECOMMENDATIONS:
Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.
Additional information
This also reproduces with other LaTeX-style control words that begin with \n or \t, for example \theta, \tilde, and \to. In those cases the CLI appears to interpret \t as a tab, so the note content is also corrupted.
I first noticed this through daily:append, but the simpler reproduction above uses append. So this seems to affect at least append and daily:append, and possibly any CLI command that accepts content=....
This looks like an extra escape-decoding step in the Obsidian CLI after shell parsing. Shell quoting alone does not prevent it.
Current workaround: avoid passing raw LaTeX or other literal backslash-heavy text through CLI content= arguments and edit the file directly instead.