⌥+⌃AltPlusCtrl

How to Send a Code Block in Slack (Ctrl+Alt+Shift+C)

Windows: Ctrl+Alt+Shift+C
Mac: Cmd+Option+Shift+C
Ctrl+Alt+Shift+C — Cmd+Option+Shift+C on macOS — turns the selection into a multi-line code block. Typing three backticks and pressing Enter does the same, and is how most people find the feature. **A code block is a container, not an inline style.** It occupies its own area with a distinct background, preserves every line break and every space, and renders in a monospaced font. That makes it right for anything with structure: a stack trace, a config file, a SQL query, a shell session, a JSON payload. Inline code on Ctrl+Shift+C is the other tool, for a fragment inside a sentence, and using one where the other belongs is the most common formatting mistake in technical channels. **Whitespace survives, and that is the whole point.** Pasting indented code into an ordinary Slack message collapses runs of spaces and reflows lines to the window width, which destroys the structure of anything indentation-sensitive. Python, YAML and Makefiles become genuinely wrong rather than merely ugly. A code block preserves the input exactly, so what the reader copies out is what you put in. **Nothing inside is reinterpreted.** Asterisks, underscores, tildes and angle brackets are all literal, URLs are not linkified, and Slack's own markup is inert. A shell command containing `~/` keeps its tilde; a log line full of asterisks stays intact. Without the block, several of those would silently become formatting and the reader would copy something subtly different from what you sent. **The triple-backtick route has one wrinkle worth knowing.** In Slack's WYSIWYG composer, typing three backticks converts to a block immediately, and everything you type afterwards goes inside it — including the Enter key, which adds a line rather than sending the message. Getting *out* of the block to write the sentence after it is the part people struggle with: pressing the down arrow past the end of the block, or clicking below it, moves the cursor out. That is also why the keyboard shortcut applied to an existing selection is often the cleaner route, since it wraps only what you chose. **Sending long output is a judgement call.** Slack collapses very long blocks behind a 'show more' control, so a 200-line log does not flood the channel — but it is still 200 lines the reader has to scroll. For anything of real length, a snippet or an uploaded file gives a better reading experience and keeps the channel scannable. The block is for the excerpt that makes the point, not the whole file. **Slack code blocks do not do syntax highlighting.** There is no language identifier to add after the backticks the way there is on GitHub, and adding one puts the word inside the block as literal text. Everything renders in one colour. For code where highlighting genuinely aids comprehension, a snippet or a link to the source is the better format. **Editing a block after sending works normally.** A code block can be edited like any other message, and the block survives the edit — you are not re-entering raw markup. That matters because a pasted snippet with a typo in it is common enough, and the alternative of deleting and resending loses the thread position and any reactions already on the message. **Threads are the right home for long output.** Posting a stack trace in a channel makes everyone scroll past it; posting it in a thread under the message that reported the problem keeps it attached to its context and out of the main flow. Slack's collapse control helps, but it does not make a long block a good neighbour in a busy channel.

Related shortcuts