Obsidian CLI: no way to escape control characters

Steps to reproduce

  1. Run obsidian create path="Inbox/cli-escape-repro.md" content="# CLI escape repro" overwrite.

  2. Run obsidian append path="Inbox/cli-escape-repro.md" content='plain nu: \nu'.

  3. Run obsidian read path="Inbox/cli-escape-repro.md".

  4. 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.

1 Like

The single quote is not something we support.

I agree, We do need to find a way to escape these control characters.

1 Like

I have a question regarding this :blush: … but it’s somewhat off-topic as it concerns property:set :innocent:.

Would these include being able to pass null as a value for the value parameter of property:set ?

When I tried (Discord message), I couldn’t find a way to either write it properly (with my basic knowledge of zsh, in general) or escape it so Obsidian would see the value as an actual null and not a string.

I’m sorry if this is a ridiculous question :sweat_smile: … I just didn’t know if I should open a separate FR or BR about this :innocent: