← Back to Blog

Short answer: If dictation works in other apps but not Terminal, turn off Secure Keyboard Entry in the Terminal menu, which can block dictation apps. Then check what is reading your words: at a shell prompt they become a command, but pagers like less and Vim's normal mode treat letters as commands.

Free to start Dictate into any app on your Mac or iPhone — hold a key, speak, release. Download for MaciPhone

You are in Terminal on your Mac, about to write a commit message or a long prompt, and you would rather say it than type it. You press your dictation shortcut, speak, and nothing appears. Or your words appear and the command runs before you have finished the sentence. Or you dictate into what looked like a prompt and your Git log vanishes, or Vim starts deleting lines. Or dictation works in every other app on your Mac and does nothing at all in Terminal.

A terminal is not a document. Every character that reaches it is input for whichever program is running inside it: your shell, an editor, a pager, or a machine on the other end of an SSH connection. Dictation, whether it is Apple's or a dictation app's, delivers text to the Terminal window as if you had typed it, and then that program decides what the text means. To the shell, a line break means "run this". To a pager, or to Vim in normal mode, most letters are commands.

So most Terminal dictation problems are about what is reading your words, not about your microphone. This guide works through every cause in order, starting with the one that stops dictation apps completely. The same fixes apply to iTerm2 and most other terminal apps. If dictation is failing in every app on your Mac and not only in Terminal, start with our complete guide to Mac dictation not working instead.

How dictation reaches Terminal

Apple dictation is built into macOS. You start it with the dictation shortcut, usually the microphone key or a double press of the Fn or Globe key, or, in most apps, from Edit, then Start Dictation in the menu bar. It sends its text to whichever window has focus. Terminal passes that text on to the program running in the active tab, exactly as it passes on your keystrokes. Terminal does not need microphone permission for Apple dictation, and there is no dictation setting inside Terminal to switch on or off.

Menu bar dictation apps, including ours, look much the same from Terminal's side. They put text at your cursor, and many of them deliver it the way a paste does. They need their own Microphone permission, plus Accessibility permission to put text into other apps, under System Settings, then Privacy & Security. Terminal itself still needs nothing.

That leaves one big rule: dictated text is input, and the program in the active tab decides what it does. Words at an empty shell prompt are harmless until you press Return. The same words sent to a pager, to an editor in the wrong mode, or to a yes-or-no question are not.

The 30-second test

Before you change anything, open TextEdit, create a blank document, start dictation and say a sentence. Then open a new Terminal window, which gives you a fresh shell prompt with nothing running, dictate the same sentence, and press Control-C to throw the line away without running it.

Control-C is your friend throughout this guide. At a shell prompt it discards whatever is on the current line, so it is the safe way to clear dictated text you do not want to run.

The 10 fixes, in order

1. Turn off Secure Keyboard Entry

This is the cause behind most "dictation works everywhere except Terminal" reports from people who use a dictation app. Terminal has a setting called Secure Keyboard Entry, in the Terminal menu in the menu bar. iTerm2 has the same option in its iTerm2 menu. When it is ticked and that terminal is the front app, macOS turns on Secure Input, a protection that stops other apps from reading or sending keystrokes. That is the whole point of the setting: it keeps other software from watching what you type into a shell.

It also gets in the way of a dictation app. While Secure Input is on, the app may not be able to see you press its hotkey, or its text may not arrive. Untick Secure Keyboard Entry and try again. If you want the protection for particular work, turn it on for that and off again afterwards.

Secure Input can also be switched on by something other than your terminal. A password field left active in a browser, a password manager or a sign-in dialog can hold it, and then a dictation app is blocked everywhere, not only in Terminal. To see which app is holding it, run this:

ioreg -l -w 0 | grep SecureInput

If a line containing kCGSSessionSecureInputPID appears, the number after it is the process ID of the app that turned Secure Input on, and ps -p followed by that number shows the app's name. Close that app's password prompt, or quit it, and try again. If the command prints nothing, Secure Input is most likely off, and the problem is elsewhere.

2. Leave pagers and full-screen programs before you speak

If dictation works at a fresh prompt but not in your working window, look at what is on screen. Many commands hand the screen to a program that reads single keys rather than lines of text. Manual pages do this, and so does Git: git log, git diff and git show open their output in a pager when it is longer than the window. So do top, htop and other full-screen tools.

In these programs, a letter is a command. In less, the pager that Git and man normally use on a Mac, q quits, a space scrolls down a page, a slash starts a search and G jumps to the end. Dictate "quick question about this branch" into a Git log and the first letter closes the log. The rest of the sentence may disappear, or turn up at the shell prompt that the log returns you to. It looks as if dictation failed. In fact it worked, and the pager did exactly what the letters told it to.

Look at the bottom line of the window before you speak. A colon, (END), or a highlighted line that mentions pressing h for help or q to quit means you are in a pager. Press q to leave it, wait for your prompt, then dictate. If Git's pager keeps catching you, you can run a single command without it, for example git --no-pager log.

The same applies whenever a command stops to ask you something. A [y/N] question, a "press any key" message or an installer's menu reads whatever arrives next as your answer, and a dictated sentence is a long, unpredictable answer. Type your reply, then go back to dictating once the prompt returns.

3. Get Vim into insert mode first

Editors are the next trap, and Git walks you into one. Run git commit without a message and Git opens an editor for you to write it in. Unless you have chosen a different editor, that is vi, which on a Mac is Vim. Vim opens in normal mode, where letters are commands: d starts a delete, x deletes a character, u undoes and i switches to typing. Depending on how the text arrives, dictating a commit message straight into normal mode can make Vim run your sentence as a string of commands.

Press i before you dictate, so Vim is ready for text. When you are done, press Escape, type :wq and press Return to save the message and finish the commit. If you dictated into normal mode and the file is a mess, press Escape, type :q! and press Return to leave without saving. Git cancels a commit whose message is empty, so nothing is committed and you can start again.

There are two ways to avoid the question altogether. Put the message on the command line: type git commit -m ", dictate the sentence, then type the closing quote (fix 6 explains why the quotes matter). Or tell Git to use an editor without modes, with git config --global core.editor nano. In nano, what you dictate is simply added to the file, Control-O saves and Control-X exits.

The same normal-mode rule applies to Neovim, and to your shell if you have switched it to vi-style editing, where pressing Escape at a prompt puts the command line into command mode. Our guide on how to dictate in Neovim covers a comfortable setup, and our guide to voice typing Git commit messages in Terminal covers the commit workflow from start to finish.

4. Never dictate a line break at a prompt

At a shell prompt, Return means run. Apple dictation turns "new line" and "new paragraph" into line breaks, and in Terminal a line break is a press of Return. Say "new line" halfway through a thought and the shell runs whatever is on the line at that moment, then treats the rest of what you said as another command. With harmless words, you get "command not found". With the wrong words, you could run something you never meant to.

Text that arrives as a paste is handled a little differently. The zsh shell that macOS uses by default recognises pasted text and keeps any line breaks in it on the command line until you press Return yourself, a feature called bracketed paste. The old version of bash that still ships with macOS does not have it, and neither does a shell where it has been switched off, so a pasted line break there runs the line straight away. iTerm2 can also ask you to confirm before it pastes text that spans several lines, and that confirmation box can look like dictation stalling.

The safe habit is to keep dictation to a single line at a prompt, read it back, and press Return yourself. For anything longer, such as a commit message with a body, dictate into an editor (fix 3) rather than at the prompt. If a command starts that you did not intend, Control-C stops most of them.

5. Strip what dictation adds for human readers

Dictation writes for people. It starts sentences with a capital letter, ends them with a full stop, writes some numbers as words and others as digits, and turns spoken symbols into whatever it thinks you meant. In a paragraph, that is helpful. In a command, each of those changes can break it:

On recent versions of macOS you can turn off Apple dictation's automatic punctuation in System Settings, under Keyboard, in the Dictation section, and punctuation you say aloud still works. But the more reliable rule is the one in our guide to voice typing in Terminal: type the syntax, dictate the words. Commands, options, paths, variable names and anything with slashes or pipes belong on the keyboard. The English around them, such as commit messages, code comments, notes and prompts for command-line tools, is where speaking saves real time.

6. Put double quotes around dictated sentences

When a dictated sentence goes inside a command, the shell reads its punctuation too, and the apostrophe is the most common casualty. Dictate "don't merge yet" inside single quotes and the apostrophe in "don't" closes the quote early. The shell then waits for a closing quote that never comes and shows a continuation prompt, quote> in zsh or a bare > in bash, instead of running anything. It looks as if Terminal has hung.

Press Control-C to leave the continuation prompt. Then wrap dictated sentences in double quotes instead: type the opening quote, dictate, type the closing quote. Double quotes let apostrophes through. Two characters still need care inside them. A dollar sign, which dictation writes when you mention money, starts a variable name, so "$50" can lose its dollar sign and its first digit. A backtick starts a command. If a sentence needs either one, type that part, or rephrase it. Our guide to dictating quotes and special characters covers how to say symbols when you actually want them.

7. Check which tab, window or pane has the cursor

Terminal sends your words to the active tab of the front window, and you may have several of each. Opening a new tab, switching apps and back, or clicking a notification can leave focus somewhere you did not expect. Terminal's Find bar is another hiding place: after Command-F, dictated words go into the search box rather than to the shell. Click in the tab you mean to use and look for the cursor before you speak.

tmux and screen add another layer, because your words go to the active pane, which is not always the one you are looking at. In tmux, copy mode, which you enter with the prefix key followed by [, turns keys into navigation and search, so dictated text moves around the scrollback instead of reaching your program. Press q to leave copy mode. And if the synchronize-panes option is on for a window, whatever you dictate goes to every pane in it at once, which is exactly as risky as it sounds. iTerm2 has a similar feature that broadcasts input to several sessions. Make sure it is off before you dictate.

8. Remember where remote sessions send your words

Over SSH, everything you dictate goes to the remote machine, which is where the shell, editor or pager reading it is running. Every fix above applies there too, and a remote session adds three more things to check:

9. Give your dictation app its permissions, and free up the microphone

A dictation app needs two permissions under System Settings, then Privacy & Security: Microphone, so it can hear you, and Accessibility, so it can put text into Terminal and every other app. If either is off, the app may record and have nowhere to deliver the result. Voice Keyboard Pro shows an alert that points you to the right settings pane when Accessibility is missing. After you grant a permission, quit the app and open it again, because macOS does not always apply a new permission to an app that is already running.

Then check the microphone. A call in a video meeting app, a screen recorder or another dictation tool can keep hold of it, and dictation opens, hears nothing and gives up. Quit those apps rather than muting them. If you use a headset, check which input your Mac is listening to, especially after unplugging or switching Bluetooth devices. Our guide to Mac dictation microphone problems covers the input side in detail.

10. Check dictation on your Mac

If dictation failed in TextEdit too, Terminal is not the problem. Open System Settings, go to Keyboard, and make sure Dictation is on. Check which shortcut it uses. If the shortcut is the Globe key, check that the setting for what pressing the Globe key does, on the same page, is not set to change the input source or show emoji instead. Make sure the dictation language matches the language you are speaking.

Then restart your Mac, which clears stuck dictation services in one step. If dictation stopped working straight after an upgrade, our guide to Mac dictation not working after a macOS update covers what tends to change, and if your shortcut does nothing at all, our guide to a Mac dictation shortcut that is not working walks through it.

Terminal quirks that look like broken dictation

Quick triage

Terminal versus the terminal in your code editor

The terminal built into a code editor follows the same rules as Terminal itself: pagers, editors, prompts and remote sessions all read your words the same way. It adds one more question, which is whether focus is in the terminal panel or in the editor above it, and editor keyboard shortcuts can fire when neither has the cursor. Our guide to Mac dictation not working in VS Code covers the editor side. For the bigger picture of where speaking helps with programming work, see our hub on dictation for coding.

A dictation workflow that suits Terminal

It is worth getting right, because speaking is much faster than typing. Most adults type around 40 words per minute, and even professional typists usually sit around 80 to 100, while normal speech runs at 130 to 150 words per minute. In a terminal, most of the words that are not commands are explanations, and explanations are exactly what people cut short when they have to type them.

Dictation that works in every tab

Apple dictation is free and built in, but it stops after a pause, it depends on settings that are easy to switch off by accident, and fixing a misheard word means going back and editing by hand.

Voice Keyboard Pro is a menu bar app for Mac. Click into your terminal, hold your hotkey, speak, and release. The text appears at your cursor, system-wide, in Terminal, in iTerm2, in your editor and in every other app you use. The microphone stays live while you hold the key, so a pause to think does not end the session. Like any dictation app, it is subject to Secure Input, and the program in the tab still decides what your words mean, so fixes 1 to 6 still apply.

A few features help with technical work in particular:

On privacy, our servers store only operational pings. No audio and no transcript content is stored, which matters when what you are dictating is about code and systems you are responsible for. There is a free tier with daily limits, and Pro is $4.99 a month or $34.99 a year. On iPhone, the same product is a custom keyboard with a built-in mic button, so you can dictate in any iOS app too.

Frequently asked questions

Does Terminal have its own dictation setting?

No. Terminal relies on the dictation built into macOS or on a dictation app. Both deliver text to the active tab, and there is nothing inside Terminal to turn on. The closest thing is Secure Keyboard Entry, which can block dictation apps while it is on.

Why does dictation work in TextEdit but not in Terminal?

If you use a dictation app, the most likely reason is Secure Keyboard Entry in the Terminal menu. If it works at a fresh prompt but not in one particular tab, a program such as a pager or Vim is reading your words as commands.

Why did my command run before I finished speaking?

You probably said "new line" or "new paragraph", and at a shell prompt a line break is a press of Return. Keep dictation at a prompt to a single line, and press Return yourself once you have read it back.

Why is Terminal stuck at a quote> prompt?

An apostrophe in your dictated text closed a single-quoted string early, and the shell is waiting for the quote to be finished. Press Control-C, then put dictated sentences inside double quotes instead.

Is it safe to dictate commands?

Dictate the words, not the syntax. Options, paths and symbols are faster and safer to type. Always read a line back before pressing Return, and never dictate passwords.

What to do next

Run the 30-second test, then work through the fixes that match what you saw. For most dictation app users it is fix 1: Secure Keyboard Entry is on, and the app cannot get through. If your words arrived and something strange happened, it is almost always fix 2, 3 or 4: a pager, Vim or a line break did what it was told. And if you want dictation that stays out of your way in the terminal and everywhere else on your Mac, try Voice Keyboard Pro's free tier on your next commit message.

Voice Keyboard Pro
Hold your key · Speak · Release

The words land at your cursor in whatever app you are already in — Mail, Slack, Word, a browser form. No dictation window, nothing to copy across.

Free forever for casual use · Apple Silicon & Intel