Skip to content

Integrated terminal: wide/fullwidth Unicode characters advance cursor by 1 column instead of 2 #433

@tig

Description

@tig

Summary

The terminal emulator in GitHub Copilot does not correctly advance the cursor for wide (fullwidth) Unicode characters. Characters that should occupy 2 terminal columns (emoji, CJK ideographs, fullwidth forms) only advance the cursor by 1 column, causing all subsequent content on the line to shift left. This breaks grid alignment and causes display "tearing" in any TUI application that uses wide characters.

Steps to Reproduce

  1. Open the integrated terminal in GitHub Copilot
  2. Paste this into the terminal:
printf '\u250c\u2500\u2500\u252c\u2500\u2500\u252c\u2500\u2500\u252c\u2500\u2500\u252c\u2500\u2500\u252c\u2500\u2500\u252c\u2500\u2500\u252c\u2500\u2500\u2510\n'
printf '\u2502\U0001f600\u2502\U0001f601\u2502\U0001f602\u2502\U0001f923\u2502\U0001f604\u2502\U0001f605\u2502\U0001f606\u2502\U0001f607\u2502\n'
printf '\u2502\u2500\u2500\u2502\u2500\u2500\u2502\u2500\u2500\u2502\u2500\u2500\u2502\u2500\u2500\u2502\u2500\u2500\u2502\u2500\u2500\u2502\u2500\u2500\u2502\n'
printf '\u2514\u2500\u2500\u2534\u2500\u2500\u2534\u2500\u2500\u2534\u2500\u2500\u2534\u2500\u2500\u2534\u2500\u2500\u2534\u2500\u2500\u2534\u2500\u2500\u2518\n'

Or run the full repro app:

git clone https://github.com/gui-cs/Terminal.Gui.git
cd Terminal.Gui/Examples/WideCharRepro
dotnet run

Expected Behavior

Each wide character occupies exactly 2 terminal columns. The grid separators are vertically aligned and the X markers all appear at column 20.

Actual Behavior

Wide characters only advance the cursor by 1 column. Grids are misaligned, text overlaps, and the display is "torn."

Screenshot (GitHub Copilot terminal)

Wide character rendering bug in Copilot terminal

Terminal Comparison

All tests pass on every other terminal tested -- only the GitHub Copilot terminal fails:

Terminal OS Result
Ghostty macOS PASS
GitHub Copilot (terminal) macOS FAIL
GitHub Copilot (terminal) Windows FAIL
iTerm2 macOS PASS
Kitty macOS PASS
Terminal.app macOS PASS
Visual Studio 2026 Windows PASS
VS Code Insiders Windows PASS
Windows Terminal Windows PASS

Impact

This makes any TUI application that renders wide characters unusable in the GitHub Copilot terminal. Affected applications include:

  • Terminal.Gui -- cross-platform .NET TUI toolkit (CharMap scenario is completely broken)
  • Any ncurses/curses-based application using CJK or emoji
  • tmux, vim, htop, etc. when displaying wide characters

Technical Details

The terminal must use the Unicode East_Asian_Width property (or an equivalent wcwidth implementation) to determine how far to advance the cursor after printing each character. Characters with East_Asian_Width = W (Wide) or F (Fullwidth) require 2 columns.

Affected Unicode ranges:

  • Emoji (U+1F600-U+1F64F, U+1F900-U+1F9FF, etc.)
  • CJK Unified Ideographs (U+4E00-U+9FFF)
  • CJK Compatibility Ideographs (U+F900-U+FAFF)
  • Fullwidth Forms (U+FF01-U+FF60)

Relevant standards:

Environment

  • OS: Windows 11 24H2 / macOS (both affected)
  • Terminal: GitHub Copilot integrated terminal
  • Shell: PowerShell 7.5
  • Font: Default (Copilot terminal font)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions