Turn off smart quotes on Mac for coding
You draft a shell command in Notes, paste it into Terminal, and it fails with a cryptic error — because macOS quietly turned your " into a curly “ and your --flag into an em-dash. That's smart quotes and smart dashes. Turn them off in System Settings → Keyboard → Text Input → Edit, or with a defaults write command, and everything you type stays literal.
Turn off smart quotes and dashes
- Open System Settings → Keyboard.
- In the Text Input section, click Edit….
- Turn off Use smart quotes and dashes.
- Click Done. New text you type in most apps now stays straight.
Prefer the command line, or scripting a fresh Mac? These two keys do the same thing — smart quotes and smart dashes are separate switches:
# keep straight quotes: "code" stays "code"
defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
# keep double hyphens: --flag stays --flag, not an em-dash
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
# undo — re-enable both
defaults delete NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled
defaults delete NSGlobalDomain NSAutomaticDashSubstitutionEnabled
No logout is needed, but apps read the setting when they launch, so quit and reopen the app you're typing in for the change to register. This works the same on macOS 13 Ventura, 14 Sonoma, and 15 Sequoia.
Where it bites — and where it never did
Real code editors — VS Code, Xcode, JetBrains, a terminal editor — don't apply smart quotes, so your source files were always safe. The damage happens in Apple's rich-text apps and then travels:
- Notes, Mail, Messages, TextEdit — you paste or write a snippet here, then copy it into a shell or config file carrying curly quotes with it.
- JSON and YAML pasted from an email — a curly
“is not a valid string delimiter, so the parser rejects it. - CLI flags —
--verbosebecoming—verbosesilently changes the argument.
Turning the setting off globally stops the conversion at the source, so anything you copy out of those apps is already correct.
Mainspring turns smart quotes and smart dashes into labelled one-click toggles you can flip off and back on — two of 90+ hidden macOS settings it makes reversible, so your snippets stay copy-paste safe without a defaults command.
Signed & notarized by Apple · 1-day free trial · $29 once
One app still curling quotes?
TextEdit and a few others keep a per-app override under Edit → Substitutions, which can re-enable smart quotes even after you've turned off the global setting. If a single app misbehaves, uncheck Smart Quotes there too. For the related autocorrect behaviour, see how to turn off autocorrect on Mac.