---
name: ms-teams-multiline-typing
description: Type multiline messages into the Microsoft Teams chat compose box using agent-browser. Covers the Shift+Enter newline pattern and why literal newline input fails. Use only when the user asks to type or compose a multi-paragraph Teams message.
---
# MS Teams multiline typing
Microsoft Teams uses a CKEditor-backed `
`, exposed in snapshots as `textbox "Type a message" multiline`. Its state lives in CKEditor's model rather than directly in the DOM.
## Required pattern
Do not send an embedded newline in one `fill`, `type`, or `keyboard type` command. CKEditor may reject the entire insertion. Focus the compose box, then alternate typing and `Shift+Enter`:
```bash
agent-browser snapshot -i -c
agent-browser click @eN
agent-browser keyboard type 'Line 1'
agent-browser press Shift+Enter
agent-browser keyboard type 'Line 2'
agent-browser press Shift+Enter
agent-browser keyboard type 'Line 3'
```
Each `Shift+Enter` produces a real keyboard event that CKEditor maps to a new paragraph or line break.
For a single line, use:
```bash
agent-browser type @eN 'Hello'
```
## Verify the draft
```bash
agent-browser eval '(() => { const e=document.querySelector("[role=textbox]"); return JSON.stringify(e ? {innerText:e.innerText,pCount:e.querySelectorAll("p").length} : null); })()'
```
A fresh `agent-browser snapshot -i -c` should also expose the inserted paragraph structure.
## Do not
- Do not use a literal `\n` in one fill/type command for the Teams editor.
- Do not mutate `innerHTML`; this can violate Trusted Types and desynchronize Teams/CKEditor state.
- Do not send the message unless the user explicitly asked to send it. Typing/composing alone means leave the draft for review.
The same keystroke pattern often works in other contenteditable chat apps. A true `