DECAWM ?7 — Auto-wrap mode
Toggle whether the cursor wraps to the next line at the right margin (default: on).
Byte forms
Every common string-literal form so you can paste-and-search either direction.
\\x1b[
\x1b[?7h (enable wrap) \x1b[?7l (disable)\\033[
\033[?7h / \033[?7l\\e[
\e[?7h / \e[?7lESC [
ESC [ ? 7 h / lhex
1b 5b 3f 37 68 / 6cDescription
DEC Auto-Wrap Mode. When enabled (`?7h`, the default), characters that would print past the rightmost column wrap to column 1 of the next row. When disabled (`?7l`), the cursor stays glued to the last column and each new character overwrites the previous one — useful for status lines and TUIs that draw exactly to the edge without unintentionally scrolling. Turn wrap off before drawing a fixed-width status bar; turn it back on before yielding the terminal back to the user, otherwise long shell-prompts truncate visibly.
Spec citation: xterm-ctlseqs (DEC Private Mode 7, DECAWM)
Examples
printf '\033[?7l' # disable wrap for status bar\nprintf '\033[?7h' # restoreimport sys; sys.stdout.write('\x1b[?7l')fmt.Print("\x1b[?7l")process.stdout.write('\x1b[?7l')printf("\x1b[?7l");Terminal support
- xterm
- yes
- Linux console (fbcon)
- yes
- macOS Terminal.app
- yes
- iTerm2
- yes
- Windows Terminal
- yes
- cmd.exe / ConPTY
- partial
- kitty
- yes
- alacritty
- yes
- WezTerm
- yes
- Ghostty
- yes
- GNOME Terminal
- yes
- Konsole
- yes
- tmux
- no
- GNU screen
- no
| xterm | Linux console (fbcon) | macOS Terminal.app | iTerm2 | Windows Terminal | cmd.exe / ConPTY | kitty | alacritty | WezTerm | Ghostty | GNOME Terminal | Konsole | tmux | GNU screen |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| yes | yes | yes | yes | yes | partial | yes | yes | yes | yes | yes | yes | no | no |