You paste a Bash one-liner into Apple Notes for safekeeping. An hour later you copy it back, paste into Terminal, hit Enter, and bash blows up: command not found: 'curl'. The reason: Apple Notes silently turned your straight quotes 'curl' into curly typographic quotes ‘curl’. Same thing happens to double quotes, hyphens (your --flag becomes –flag em-dash), and three dots becoming an ellipsis character.
This is “smart punctuation,” an Apple-wide setting that’s mostly nice for writing prose and absolutely terrible for storing code. Here’s the one System Settings change that turns it off everywhere on macOS, plus the equivalent for iOS, plus the workaround if you can’t (or don’t want to) disable it system-wide.
The system-wide off switch on macOS
The setting lives in System Settings → Keyboard → Text Input → Edit…. In that panel:
- Uncheck Use smart quotes and dashes — this disables both the quote-to-curly and the double-hyphen-to-em-dash substitutions.
- While you’re here, also uncheck Capitalize words automatically and Add period with double-space, which mangle code in their own way (auto-capitalizing variable names, adding stray periods).
- Leave Correct spelling automatically on or off as you prefer; it doesn’t affect code unless you have monstrously bad variable names.
Click Done. The change applies system-wide: Apple Notes, TextEdit, Mail, Messages, Pages, every app that uses macOS’s NSText framework. The change does NOT apply retroactively — existing curly quotes in old notes stay curly. Only new typing/pasting honors the new setting.
Fixing notes you’ve already polluted
You probably have years of notes with curly quotes in them. Bulk-fixing inside Apple Notes specifically is a chore because Notes’ built-in Find & Replace doesn’t handle curly characters well. The fastest workflow:
- Open the offending note.
- Cmd+A to select all, Cmd+C to copy.
- Open BBEdit (free) or TextEdit in Plain Text mode (Format → Make Plain Text). Cmd+V the content in.
- Use Find & Replace four times:
‘→',’→',“→",”→". Also–/—→--, and…→... - Cmd+A, Cmd+C, paste back into Apple Notes (with smart-quotes now disabled, the paste is preserved verbatim).
Or, the one-liner version using pbpaste and pbcopy:
# copy the polluted text first, then run:
pbpaste | sed -e $'s/\xe2\x80\x98/\x27/g; s/\xe2\x80\x99/\x27/g; s/\xe2\x80\x9c/"/g; s/\xe2\x80\x9d/"/g; s/\xe2\x80\x93/--/g; s/\xe2\x80\x94/--/g; s/\xe2\x80\xa6/.../g' | pbcopy
# now paste back, you have ASCII clean textiOS — same setting, different path
Same fix on iPhone / iPad: Settings → General → Keyboard → Smart Punctuation → Off. Now when you type or paste code in Notes on iOS, the quotes stay straight. iCloud sync between Mac and iOS respects the locally-typed character — if you typed it on Mac with smart-quotes off, iOS won’t re-mangle it.
If you don’t want to disable it everywhere
Some people use Notes for actual prose-writing as well as code, and curly quotes look nicer in prose. The compromise: keep smart-quotes ON system-wide, and use one of these per-snippet workarounds.
- Use the “Monospaced” paragraph style. In Apple Notes, select the snippet, hit Cmd+Shift+M (or use the format menu → Monospaced). When a paragraph is in monospaced style, Notes does NOT apply smart-punctuation substitution to it. This is the cleanest per-snippet fix.
- Paste with Cmd+Shift+Option+V (Paste and Match Style). Doesn’t actually help — the substitution still happens because it’s done at typing/pasting time. Skip this.
- Use a code-block app instead of Notes. If you write code 50+ times a day, switch the snippet store to Bear (markdown-aware) or Snippets Lab (purpose-built). Apple Notes is a writing tool, not a code-keeper.
The thing I wish I’d learned earlier
The Monospaced paragraph style (Cmd+Shift+M) is doing more than just changing the font. It actually opts that paragraph out of every text-substitution behavior Apple Notes does — smart quotes, em-dash conversion, ellipsis, the whole pipeline. Three years of cursing that “the curly quotes broke my YAML” and the fix was a single keyboard shortcut that I’d never bothered to learn.
Workflow that’s stuck for me: I keep smart punctuation on at the system level (because prose), and I have a TextExpander snippet for “new code note” that auto-types Cmd+Shift+M after creating a fresh Note. So every new note starts in monospaced mode. Code goes in, comes out unmangled, and the rest of the system still gives me nice em-dashes when I’m writing an email.
Test it’s working
After making the change, in any text field:
# type these characters and watch what happens:
"hello world"
'curl --version'
this -- that
three...dotsIf smart-quotes is off, all four lines stay exactly as typed. If you see “hello world”, ‘curl –version’, this — that, or three…dots — the setting didn’t take. Quit and relaunch the app you’re testing in (or log out / log back in to be sure). System Settings changes don’t always propagate to already-running apps.
This is a 30-second fix that has saved me from hours of confused debugging when a copy-pasted command silently misbehaves. Worth the trip into System Settings.
Photo: Hands typing code on a MacBook by goumbik on Pexels.
