# Operating system commands

> Text-carrying commands for things outside the screen grid, such as the window title and the colors.

Text-carrying commands for things outside the screen grid: the window title,
the colors, and more. ECMA-48 defines only the frame, `OSC`, a string, and
`ST`; what goes in the string was left to each system. Nearly all the numbers
in use are xterm's, and a terminal that has them follows xterm's meaning.

- [OSC 9999: Agent Status](https://control-codes.page/osc/agent-status/index.html.md): Report a coding agent's state to Orca, which shows it on a dashboard of every agent it runs.
- [OSC 776: Report Cell Size](https://control-codes.page/osc/cell-size/index.html.md): Ask rxvt-unicode for the size of a character cell and its font's ascent, in pixels.
- [OSC 4: Change Color Palette](https://control-codes.page/osc/palette/index.html.md): Set and query the colors that SGR's color numbers stand for.
- [OSC 46: Change Log File](https://control-codes.page/osc/logfile/index.html.md): Tell xterm which file to log its session to, in a build that can log.
- [OSC 52: Manipulate Selection Data](https://control-codes.page/osc/clipboard/index.html.md): Let a program set or read the clipboard, even over ssh.
- [OSC 9 ; 11: Comment](https://control-codes.page/osc/conemu-comment/index.html.md): A comment, to be skipped.
- [OSC 3008: Hierarchical Context Signalling](https://control-codes.page/osc/context/index.html.md): Tell the terminal when a shell, a command, a container or a privileged session starts and ends.
- [OSC 9: Desktop Notification](https://control-codes.page/osc/notify/index.html.md): Ask the terminal to show a desktop notification.
- [OSC 72: Drag and Drop](https://control-codes.page/osc/dnd/index.html.md): Let a program in the terminal accept dropped files and text, and start drags of its own: kitty's drag and drop protocol.
- [OSC 9 ; 8: Environment Variable](https://control-codes.page/osc/conemu-env/index.html.md): Write out an environment variable.
- [OSC 555: Flash Screen](https://control-codes.page/osc/flash/index.html.md): Flash the whole terminal briefly, foot's extension.
- [OSC 7777: Set Font and Window Size](https://control-codes.page/osc/font-window-size/index.html.md): Set mintty's font size and resize its window with it, keeping its rows and columns.
- [OSC 7770: Set Font Size](https://control-codes.page/osc/font-size/index.html.md): Set mintty's font size, or change it by steps, without resizing the window.
- [OSC 17: Highlight Background Color](https://control-codes.page/osc/highlight-background/index.html.md): Set and query the color of the background of selected text.
- [OSC 19: Highlight Foreground Color](https://control-codes.page/osc/highlight-foreground/index.html.md): Set and query the color of selected text.
- [OSC 8: Hyperlink](https://control-codes.page/osc/hyperlink/index.html.md): Make text a link, the way an anchor does in HTML.
- [OSC 1337: iTerm2 Extensions](https://control-codes.page/osc/iterm2/index.html.md): iTerm2's own commands: inline images, marks, user variables, the clipboard and the working directory, and its other OSC extensions.
- [OSC 5522: Clipboard by MIME Type](https://control-codes.page/osc/kitty-clipboard/index.html.md): Read and write the clipboard by MIME type, with permission and status: kitty's clipboard protocol.
- [OSC 21: Kitty Colors, or DECSWT](https://control-codes.page/osc/kitty-color/index.html.md): Two meanings for one number: kitty's protocol for querying and setting colors, and DEC's VT520 Set Window Title, which xterm follows.
- [OSC 99: Desktop Notifications](https://control-codes.page/osc/kitty-notify/index.html.md): Show desktop notifications with titles, icons, buttons and updates: kitty's notification protocol.
- [OSC 701: Set Locale](https://control-codes.page/osc/locale/index.html.md): Set the locale rxvt-unicode reads its input in, or ask for it.
- [OSC 9 ; 2: Message Box](https://control-codes.page/osc/conemu-message/index.html.md): Show a message box.
- [OSC 440: Play Sound](https://control-codes.page/osc/sound/index.html.md): Play a sound file, mintty's extension.
- [OSC 14: Pointer Background Color](https://control-codes.page/osc/pointer-background/index.html.md): Set and query the color of the mouse pointer's outline.
- [OSC 13: Pointer Foreground Color](https://control-codes.page/osc/pointer-foreground/index.html.md): Set and query the color of the mouse pointer, while it is over the window.
- [OSC 22: Change Pointer Shape](https://control-codes.page/osc/pointer/index.html.md): Change the shape of the mouse pointer while it is over the terminal.
- [OSC 30101: Pop Colors](https://control-codes.page/osc/pop-colors/index.html.md): Restore the colors from kitty's stack.
- [OSC 9 ; 4: Progress Report](https://control-codes.page/osc/progress/index.html.md): Show a program's progress in the tab and the taskbar.
- [OSC 9 ; 12: Prompt Start](https://control-codes.page/osc/conemu-prompt/index.html.md): Mark where the shell's prompt starts, the ConEmu way.
- [OSC 30001: Push Colors](https://control-codes.page/osc/push-colors/index.html.md): Save the colors on kitty's stack.
- [OSC 62: Query Allowable Features](https://control-codes.page/osc/allowable/index.html.md): Ask xterm what all the parts of one of its guarded features are.
- [OSC 60: Query Allowed Features](https://control-codes.page/osc/allowed/index.html.md): Ask xterm which of its optional, security-sensitive features are allowed.
- [OSC 61: Query Disallowed Features](https://control-codes.page/osc/disallowed/index.html.md): Ask xterm which parts of one of its guarded features are refused while that feature is off.
- [OSC 51: Reserved for Emacs](https://control-codes.page/osc/emacs/index.html.md): A number xterm sets aside for the Emacs shell, and does nothing with itself.
- [OSC 104: Reset Color Palette](https://control-codes.page/osc/reset-palette/index.html.md): Put palette colors back as they started.
- [OSC 117: Reset Highlight Background Color](https://control-codes.page/osc/reset-highlight-background/index.html.md): Put the highlight background color back as it started.
- [OSC 119: Reset Highlight Foreground Color](https://control-codes.page/osc/reset-highlight-foreground/index.html.md): Put the highlight foreground color back as it started.
- [OSC R: Reset Palette (Linux)](https://control-codes.page/osc/linux-reset-palette/index.html.md): Put the palette back, as the Linux console does.
- [OSC 114: Reset Pointer Background Color](https://control-codes.page/osc/reset-pointer-background/index.html.md): Put the pointer background color back as it started.
- [OSC 113: Reset Pointer Foreground Color](https://control-codes.page/osc/reset-pointer-foreground/index.html.md): Put the pointer foreground color back as it started.
- [OSC 105: Reset Special Color](https://control-codes.page/osc/reset-special-colors/index.html.md): Put xterm's special colors back as they started.
- [OSC 116: Reset Tektronix Background Color](https://control-codes.page/osc/reset-tek-background/index.html.md): Put the tektronix background color back as it started.
- [OSC 118: Reset Tektronix Cursor Color](https://control-codes.page/osc/reset-tek-cursor/index.html.md): Put the tektronix cursor color back as it started.
- [OSC 115: Reset Tektronix Foreground Color](https://control-codes.page/osc/reset-tek-foreground/index.html.md): Put the tektronix foreground color back as it started.
- [OSC 111: Reset Text Background Color](https://control-codes.page/osc/reset-background/index.html.md): Put the text background color back as it started.
- [OSC 112: Reset Text Cursor Color](https://control-codes.page/osc/reset-cursor-color/index.html.md): Put the text cursor color back as it started.
- [OSC 110: Reset Text Foreground Color](https://control-codes.page/osc/reset-foreground/index.html.md): Put the text foreground color back as it started.
- [OSC 9 ; 6: Run a Macro](https://control-codes.page/osc/conemu-macro/index.html.md): Run a ConEmu GuiMacro.
- [OSC 9 ; 7: Run a Process](https://control-codes.page/osc/conemu-run/index.html.md): Run a program.
- [OSC 777: Perl Extension Command](https://control-codes.page/osc/rxvt/index.html.md): Pass a string to one of rxvt-unicode's Perl extensions; with the prefix notify, show a desktop notification.
- [OSC 702: Report Version](https://control-codes.page/osc/urxvt-version/index.html.md): Ask rxvt-unicode for its name and version.
- [OSC 720: Scroll View Up](https://control-codes.page/osc/scroll-view/index.html.md): Move rxvt-unicode's view up or down its scrollback, or clear the scrollback.
- [OSC 21337: Session Status](https://control-codes.page/osc/iterm2-status/index.html.md): Set the status text and indicator iTerm2 shows in a tab.
- [OSC 176: Set App ID](https://control-codes.page/osc/app-id/index.html.md): Set the app ID that a Wayland compositor, or an X window manager, groups and decorates the terminal's window by.
- [OSC 50: Set Font](https://control-codes.page/osc/font/index.html.md): Change xterm's font, or ask which one it is using.
- [OSC 710: Set Normal Font](https://control-codes.page/osc/urxvt-font/index.html.md): Set rxvt-unicode's normal, bold, italic or bold italic font, or ask for it.
- [OSC 1: Set Icon Name](https://control-codes.page/osc/icon/index.html.md): Set the name the window manager shows for the terminal's window when it is iconified.
- [OSC 0: Set Icon Name and Window Title](https://control-codes.page/osc/icon-and-title/index.html.md): Set the window's title and its icon name to the same text.
- [OSC L: Set Icon Name (dtterm)](https://control-codes.page/osc/dtterm-icon/index.html.md): Set the icon name, as Sun's terminals and dtterm did.
- [OSC I: Set Icon (dtterm)](https://control-codes.page/osc/dtterm-icon-file/index.html.md): Set the window's icon from a file, as dtterm did.
- [OSC P: Set Palette (Linux)](https://control-codes.page/osc/linux-palette/index.html.md): Change a palette color, as the Linux console does.
- [OSC 2: Set Window Title](https://control-codes.page/osc/title/index.html.md): Set the title of the terminal's window or tab.
- [OSC l: Set Window Title (dtterm)](https://control-codes.page/osc/dtterm-title/index.html.md): Set the window title, as Sun's terminals and dtterm did.
- [OSC 3: Set X Property](https://control-codes.page/osc/x-property/index.html.md): Set or delete a property on the terminal's top-level X window.
- [OSC 133: Semantic Prompt](https://control-codes.page/osc/prompt/index.html.md): Mark where a shell's prompt, the command typed at it, and the command's output begin and end.
- [OSC 9 ; 1: Sleep](https://control-codes.page/osc/conemu-sleep/index.html.md): Pause output for a number of milliseconds.
- [OSC 106: Special Color Modes](https://control-codes.page/osc/color-mode-106/index.html.md): The same as OSC 6: turn xterm's special colors on and off.
- [OSC 6: Enable Special Color](https://control-codes.page/osc/color-mode/index.html.md): Turn on or off xterm's use of a special color for bold, underlined, blinking, reversed or italic text.
- [OSC 5: Change Special Color](https://control-codes.page/osc/special-colors/index.html.md): Set and query the colors xterm can draw bold, underlined, blinking, reversed and italic text in.
- [OSC 34: Tab Color (Konsole)](https://control-codes.page/osc/konsole-tab-color/index.html.md): Set the color of Konsole's tab.
- [OSC 32: Tab Icon (Konsole)](https://control-codes.page/osc/konsole-tab-icon/index.html.md): Set the icon of Konsole's tab.
- [OSC 9 ; 3: Tab Title](https://control-codes.page/osc/conemu-tab-title/index.html.md): Set the text of the tab.
- [OSC 30: Tab Title (Konsole)](https://control-codes.page/osc/konsole-tab-title/index.html.md): Set the title of Konsole's tab.
- [OSC 16: Tektronix Background Color](https://control-codes.page/osc/tek-background/index.html.md): Set and query the color of the background of xterm's Tektronix 4014 window.
- [OSC 18: Tektronix Cursor Color](https://control-codes.page/osc/tek-cursor/index.html.md): Set and query the color of the cursor in xterm's Tektronix 4014 window.
- [OSC 15: Tektronix Foreground Color](https://control-codes.page/osc/tek-foreground/index.html.md): Set and query the color of what is drawn in xterm's Tektronix 4014 window.
- [OSC 666: Set Terminal Property](https://control-codes.page/osc/termprop/index.html.md): Set, reset or signal VTE's typed terminal properties, which the program embedding VTE can watch.
- [OSC 11: Text Background Color](https://control-codes.page/osc/background/index.html.md): Set and query the color of the default background, behind text with no SGR background color.
- [OSC 12: Text Cursor Color](https://control-codes.page/osc/cursor-color/index.html.md): Set and query the color of the text cursor.
- [OSC 10: Text Foreground Color](https://control-codes.page/osc/foreground/index.html.md): Set, query and reset the default foreground color.
- [OSC 66: Text Sizing](https://control-codes.page/osc/text-sizing/index.html.md): Draw text larger than one cell, or in a width the program chooses: kitty's text sizing protocol.
- [OSC 633: VS Code Shell Integration](https://control-codes.page/osc/vscode/index.html.md): VS Code's marks for prompts, commands and their output, with the command line and properties added to OSC 133's.
- [OSC 9 ; 5: Wait for a Key](https://control-codes.page/osc/conemu-wait/index.html.md): Wait for Enter, Space or Esc.
- [OSC 7: Report Working Directory](https://control-codes.page/osc/cwd/index.html.md): Tell the terminal which directory the shell is in.
- [OSC 9 ; 9: Working Directory](https://control-codes.page/osc/conemu-cwd/index.html.md): Tell the terminal the shell's working directory, the ConEmu way.
- [OSC 31: Working Directory (old Konsole)](https://control-codes.page/osc/konsole-cwd/index.html.md): Tell Konsole the shell's working directory, as Konsole once read it.
- [OSC 9 ; 10: xterm Emulation](https://control-codes.page/osc/conemu-xterm/index.html.md): Turn ConEmu's xterm emulation on or off.

---

This is the Markdown version of <https://control-codes.page/osc/>. On that page every validation case runs live in libghostty-vt, the terminal emulation core of Ghostty, compiled to WebAssembly.
