mirror of
https://github.com/microsoft/terminal.git
synced 2026-09-25 00:15:10 +00:00
Bad characters occasionally displayed when writing lots of identical UTF-8 lines #580
Closed
opened 2026-01-30 21:56:01 +00:00 by claunia
·
36 comments
No Branch/Tag Specified
main
dev/duhowett/stop-using-projection-for-control-innards
dev/duhowett/fhl-2026/remove-paste-hairpin-handler
dev/duhowett/win7-wpf-termcontrol-squash
dev/lhecker/20226-present-leaks
dev/duhowett/wpf-1-autoscroll-to-interactivity
dev/duhowett/wpf-3-swapchain-handle
dev/duhowett/wpf-2-midi-audio-timer
dev/migrie/overview-for-pr
dev/migrie/b/markdown-paste
dev/duhowett/padding-in-atlas
fix/german-split-pane-tooltip
release-1.25
dev/cazamor/sui-rejuv/fix-spaces
dev/migrie/per-window-final
dev/cazamor/selfhost/2026-08-31
dev/migrie/b/independent-animations
dev/pabhoj/wtcli
dev/cazamor/conhost/bugfix-a11y-find
dev/cazamor/conhost/bugfix-a11y-find-1.24
dev/lhecker/theme-quality-test
dev/lhecker/theme-quality
dev/cazamor/selfhost/sui-rejuv
dev/cazamor/fix/search-selection-off-by-one
dev/duhowett/even-more-builtin-glyphs
dev/crutkas/kitty-pr1
dev/cazamor/toast/activity
release-1.24
users/GitHubPolicyService/d8615b98-f5fa-4462-bf7f-c44a1cc12096
dev/cazamor/selfhost/2026-06-18
dev/migrie/f/new-profile-subcommand
dev/cazamor/sui-rejuv/profiles-v2
dev/duhowett/asan-for-all
dev/cazamor/sui-rejuv/profiles-new
dev/cazamor/sui-rejuv/expander-groups-new
dev/cazamor/auto-save/refresh-settings
feature/llm
dev/cazamor/auto-save/model/json-manager
dev/cazamor/auto-save/settings-model
dev/migrie/s/snippet-params
users/merlinbot/1es-pt-auto-baselining-pr
niels9001/inactive-tab-foreground
dev/cazamor/selfhost/2026-05-20-home
dev/duhowett/fzf-vcxproj
dev/cazamor/selfhost/2026-05-20
dev/cazamor/selfhost/2026-05-19
dev/cazamor/selfhost/2026-05-18
niels9001/fontweight-fixes
niels9001/page-transitions
dev/duhowett/fhl-2026/rewrite-paste-and-dragdrop-handling-writeinputstring
dev/migrie/f/overview-view
dev/cazamor/selfhost/2026-05-13
dev/cazamor/selfhost/2026-05-13-sui
dev/yeelam/f/BuildTest
dev/duhowett/hax/our-own-tabview
dev/cazamor/bugfix/close-scratchpad
dev/cazamor/selfhost/2026-05-05
dev/cazamor/selfhost/2026-05-04-workspaces
dev/cazamor/selfhost/2026-05-04
dev/lhecker/20149-hotfix
dev/lhecker/osc-7-wsl
dev/migrie/workspaces-real
dev/migrie/fhl-spring-2026/quake-4
dev/lhecker/pwsh-5.1
dev/cazamor/sui/dropdown-page
dev/cazamor/selfhost/2026-04-08
dev/cazamor/selfhost/2026-04-06
dev/migrie/fhl-spring-2026/confirmCloseOn
dev/cazamor/confirmCloseOn/dont-ask-me-again
dev/lhecker/inproc-conpty
dev/duhowett/powershell-module-supercharger
dev/cazamor/a11y/vt-seq-prototype
dev/migrie/fhl-spring26/osc777-2
dev/migrie/fhl-spring26/2/notification-infrastructure
dev/migrie/fhl-spring-2026/side-tabs
dev/cazamor/copilot/playground
dev/migrie/fhl-spring-2026/quake-3.5
dev/migrie/fhl-spring26/osc777
dev/migrie/fhl-spring26/unpackaged-notify
dev/migrie/fhl-spring26/bellStyle-notification
dev/migrie/fhl-spring26/activity-notifications
dev/migrie/fhl-spring-2026/x-open
dev/migrie/fhl-spring-2026/quake-5
dev/migrie/fhl-spring26/nextTab-filter
dev/duhowett/atlas-draw-d2d-dots-curlies-consistently
dev/lhecker/14165-conhost-font-size
dev/lhecker/ottosson-by-default
dev/duhowett/hax/unix-pty
dev/duhowett/hax/cmake
dev/lhecker/generate-256-colors
dev/lhecker/dcs-perf
dev/lhecker/1410-large-scrollback
dev/cazamor/selfhost/2026-02-10
dev/lhecker/11509-kitty-keyboard-protocol-wip
dev/cazamor/selfhost/2026-01-29
dev/lhecker/benchcat-fix
dev/duhowett/eoy-25/allow-set-foreground
release-1.23
dev/cazamor/bot/deprecate-area-atlasengine
dev/cazamor/selfhost/2026-01-20
dev/cazamor/selfhost/2026-01-12
dev/cazamor/spec/auto-save
dev/duhowett/fhl-2024/asciicast-recorder
dev/duhowett/eoy-25/underline-colors-in-atlas-bug
dev/duhowett/hax/serial-port-support
dev/duhowett/connection-utf8
dev/lhecker/fused-event
dev/lhecker/18928-wip
dev/duhowett/fhl-2024/clang
dev/duhowett/vt-cache-changes
dev/cazamor/uia-leak
release-1.22
dev/cazamor/selfhost/11-18-v3
dev/cazamor/selfhost/11-18
dev/duhowett/fhl-2025/bitmap-fonts
dev/duhowett/server-2025-vms
dev/duhowett/cant-believe-gotta-do-this-shit
dev/lhecker/dark-mode
dev/cazamor/sui/invert-cursor-color
dev/duhowett/fhl-2025/wt-command-palette-cmdpal-integration
dev/duhowett/fhl-2025/wt-json-relative-icons
dev/lhecker/fucking-service-locator
dev/duhowett/unicode-17
dev/duhowett/multi-blern
dev/lhecker/wellp2-alt
dev/duhowett/wellp2
dev/lhecker/1860-horizontal-scrollbar
dev/lhecker/fix-window-count
dev/cazamor/sui/tab-color-old
dev/duhowett/hax/conhost-icon
dev/duhowett/hax/sui-color-chip-border
dev/duhowett/hax/terminalsettings-as-a-lib-/with-types-merged-into-tsm
dev/pabhoj/page_control_input_cleanup
dev/duhowett/padding-in-atlas-rebase-20250729
dev/lhecker/attach-thread-input
dev/duhowett/portable-shader-members
msbuildcache-reenable
dev/cazamor/selfhost/1.24-2025-06-10
dev/cazamor/upgrade-settings-containers
dev/cazamor/sui/ext-page/powershell-stub
dev/cazamor/selfhost/1.24-2025-05-15
dev/pabhoj/sui_action_overhaul
dev/cazamor/selfhost/1.24-2025-05-06
dev/cazamor/selfhost/1.24-2025-04-29
dev/cazamor/sui/ext-page/lazy-load-objects
dev/cazamor/sui/ext-page/badge
dev/cazamor/selfhost/1.24
dev/lhecker/sdk-26100
dev/duhowett/testing
dev/jadelaga/VS-Pty.Net-1.22
dev/duhowett/fhl-2025/what-if-no-content-ids
dev/lhecker/18584-part2
dev/lhecker/get-lang-id
dev/duhowett/hax/clogs
release-1.21
dev/pabhoj/featurellm_fix_paste
dev/lhecker/grapheme-backup
dev/jadelaga/VS-Pty.netFixes
dev/lhecker/atlas-engine-compute-shader
dev/migrie/s/ai-providers
dev/lhecker/animated-cursor-wip
dev/pabhoj/featurellm_timeout
dev/lhecker/dark-mode-alt
dev/duhowett/osc-strided-table
dev/lhecker/bugbash
dev/pabhoj/featurellm_improve_parsing
dev/duhowett/coast-to-coast
dev/lhecker/curly-improvements
dev/duhowett/net8
dev/duhowett/onebranch-custom-pool
dev/lhecker/renderer-overhaul-2nd-attempt
dev/lhecker/cleanup
dev/cazamor/sui/confirmation-announcements
dev/lhecker/winconpty-cleanup
dev/duhowett/learn/rewrite-highlights
dev/migrie/b/no-nesting-when-searching
release-1.20
dev/duhowett/sel-2-spans
dev/lhecker/7118-cursor-color
dev/lhecker/remove-glyph-width
dev/lhecker/igfw-scroll-region
dev/lhecker/17656-win32im-double-encoding
dev/duhowett/fhl-2024/merge-idls
dev/duhowett/feed-forward-variables
dev/lhecker/remove-chrome-math
dev/duhowett/copylink
dev/duhowett/applicableactions
gh-readonly-queue/main/pr-17566-de50310295b7d92ed3d51f07974a2a945776bf9d
dev/lhecker/atlas-engine-stride-copy
dev/migrie/b/bump-nuget-in-c
dev/migrie/f/992-redux-redux
dev/migrie/f/filter-weight-input-too
dev/migrie/f/disable-nesting
dev/migrie/f/local-snippets-cleaner
dev/migrie/s/1553-mouse-bindings
selfhost-1.22-bugbash-2024-06-04
selfhost/1.22-bugbash-2024-06-04
dev/lhecker/15689-tab-drag-crash-fix
dev/migrie/f/sxnui-font-size-change
dev/migrie/f/local-snippets-on-action-refactor
dev/migrie/f/just-local-snippets
dev/migrie/save-input-patches
dev/migrie/f/md-pane-official
dev/migrie/base-pane
dev/migrie/fhl/tasks-pane
release-1.19
dev/migrie/b/17130-clear-marks-2
dev/migrie/b/17075-its-me-the-killer
dev/duhowett/i-figured-out-why-sometimes-the-publish-build-failed
dev/duhowett/nuget-publication-with-aad-app-id
selfhost-1.20
dev/duhowett/graph
dev/migrie/b/15803-activate-dont-copypasta
dev/duhowett/is-pgo-broken-because-of-sui-being-slower
dev/migrie/b/remove-terminaltab
dev/migrie/fhl/md-pane
dev/migrie/fhl/local-tasks-2024
dev/migrie/fhl/2024-inline-notebook
dev/duhowett/interface-projects
dev/duhowett/dead-loc
release-1.18
dev/migrie/fhl/2024-spring-merge-base
dev/duhowett/hax/l9
inbox
dev/migrie/14073-on-main
dev/duhowett/hax/conhost_dump_replay
user/lhecker/atlas-engine-srgb
dev/migrie/fhl/sxnui-tooltips-3
dev/migrie/7718-notifications-experiments
dev/migrie/fhl/7718-notifications
dev/migrie/fhl/7718-notifications-reboot
dev/lhecker/remove-gsl
dev/lhecker/16575-TerminateProcess
dev/lhecker/window-thread-climate-control
dev/lhecker/client-context-input-output-mode
dev/lhecker/ring-buffer-input-buffer
release-1.17
dev/lhecker/propsheet-fontdlg-refactor
dev/lhecker/renderer-overhaul
dev/pabhoj/test
dev/duhowett/chop
dev/lhecker/til-ulong-cleanup
dev/lhecker/til-env-cleanup
dev/migrie/f/16005-a11y-pane
dev/cazamor/a11y/fastpass
dev/migrie/b/15487-push-cwd
dev/migrie/b/15536-or-15219-idk
dev/duhowett/move-timers-down-into-core-interactivity-etc
dev/migrie/b/15812-broadcast-paste-two
dev/migrie/fhl-fall-2023/11162-quake-III-arena
dev/migrie/fhl-fall-2023/1620-automatic-tab-progress
dev/migrie/fhl-fall-2023/9992-quake-II
dev/migrie/fhl-fall-2023/9992-default-quake-settings
dev/migrie/fhl-fall-2023/9992-window-name-settings
dev/migrie/fhl-fall-2023/oceans
dev/lhecker/ColorScheme-improvements
dev/migrie/search-v2-v3
dev/migrie/pr-15717/its-dangerous-to-go-alone
dev/migrie/f/4768-taskbar-icons
dev/migrie/f/3121-tooltips
dev/duhowett/sticky-control
dev/duhowett/fix-tracing-2
dev/migrie/b/add-support-for-vsc-marks
dev/migrie/f/1860-this-is-literally-what-less-is-for
dev/migrie/s/5916-draft
dev/lhecker/tracy
dev/migrie/s/north-star
dev/cazamor/tag-youre-it
dev/migrie/f/12336-let-it-mellow
dev/migrie/f/now-with-more-compat-settings
dev/migrie/f/compatibility-sui
dev/duhowett/hax/wpf-atlas
dev/duhowett/fgb
dev/migrie/b/15487-relative-paths-are-hard
dev/lhecker/colrv1
loc-update
dev/migrie/fhl/dyndep-csharp
dev/migrie/fhl/dyndep
dev/migrie/fhl-clickable-send-input
dev/migrie/f/cwd-hijinks-5506-15173
dev/lhecker/openconsole-async-start
1.17
dev/migrie/bump-scratch
dev/migrie/f/3726-restartConnection
dev/migrie/b/cxn-restarting-attempt-1-backport
dev/migrie/b/9053-part-3-the-actual-doing-of-the-thing
dev/migrie/b/13388-focus-logger
dev/migrie/b/9053-part-4-i-guess-defterm
dev/migrie/oop/3/of-the-silmarils
of-the-darkening-of-valinor
dev/migrie/fhl/notebook-proto-000
dev/migrie/f/narrator-buddy
dev/migrie/mux-2.8.2-march-2023
dev/migrie/f/roast-mutton
dev/migrie/f/12861-preview-input
dev/lhecker/clang-tidy
dev/migrie/f/3121-wE-dOnT-hAvE-dEv-DaYs
dev/duhowett/compiler-compliance
dev/duhowett/i-have-a-burning-hatred-for-ntstatus-of-later-so-why-not-fix-it
dev/duhowett/shorthand-namespaces
dev/duhowett/rename-all-dlls
dev/duhowett/errordialog
dev/lhecker/gsl-narrow
dev/migrie/b/11522-dumb-idea
release-1.16
dev/miniksa/env
dev/duhowett/hax/embed-everything
dev/migrie/b/13388-attempt-003
dev/migrie/b/14512-test-research
dev/migrie/b/13388-attempt-002
dev/migrie/b/14464-copyOnSelect-moving-text
dev/migrie/s/thema-schema-for-1.16
dev/migrie/s/theme-pair-schema
dev/migrie/b/13388-experiments-1
dev/cazamor/spec/a11y-vt-seq
dev/migrie/b/14557-empty-folder-dropdown
dev/cazamor/spec/a11y-vt-seq-v2
release-1.15
dev/migrie/f/process-model-v3-test-0
dev/lhecker/vsconfig
dev/migrie/s/5000-presentation
dev/lhecker/5907-startup-perf
dev/lhecker/winrt-file-api-benchmark
dev/duhowett/128-bit-compiler
dev/migrie/fhl/more-shell-integration
dev/migrie/b/13388-experiments-0
dev/lhecker/til-to-ulong-improvements
dev/migrie/s/markdown-notebooks
dev/cazamor/a11y/nav-by-page
dev/cazamor/a11y/system-menu-support
dev/duhowett/no-private-registry-keys
dev/cazamor/wpf/uia-expose-enable-events
dev/cazamor/wpf/uia-events
extendAISpec
dev/migrie/fhl/clickSendInput
dev/migrie/fhl/save-command
dev/migrie/b/theme.profile
dev/migrie/b/13943-a-test-for-this
dev/migrie/oop/2/endgame
dev/duhowett/hax/merge_idl
dev/migrie/oop/2/infinity-war
dev/migrie/spellbot-cve
dev/cazamor/a11y-sev3/new-profile-announcement
dev/migrie/fhl/upside-down-mode
release-1.14
dev/migrie/f/9458-startupInfoToTerminal
dev/migrie/fhl/5916-triggers
dev/migrie/b/13523-context-menu
dev/migrie/b/6523-endpaint-outside-lock
dev/migrie/b/12413-OnUnhandledException
dev/lhecker/render-snapshot
dev/cazamor/1.15/scroll-to-point
dev/migrie/mux-2.8-aug-2022
dev/lhecker/lock-console-guard
dev/migrie/f/1504-final
dev/pabhoj/sui_follow_ups
dev/migrie/f/til-winrt.h
dev/cazamor/color-picker-redesign
dev/migrie/fhl/vscode-autocomplete-prototype
dev/migrie/f/1504-prototype
dev/migrie/oop/2/loki
dev/migrie/oop/2/wandavision
dev/migrie/b/8698-YOURE-OUT-OF-ORDER
fabricbot-configuration-migration
dev/migrie/b/12788-did-it-work
dev/migrie/b/localtests-ci-2022
dev/cazamor/1.14/replace-compareInBounds
dev/pabhoj/preview_string
dev/cazamor/ks/switchSelectionEndpoint
dev/migrie/oop/2/COM-ISwapChainProvider-attempt-1
dev/migrie/b/dxd-marker
release-1.13
dev/migrie/b/13066-for-defterm
dev/cazamor/revert-dwm
dev/migrie/b/13066-sw_flash_repeatedly
dev/migrie/b/no-cloaky-cloak
dev/migrie/f/apples-to-oranges
dev/migrie/f/no-custom-caption-btns
dev/migrie/f/10509-mica-and-transparent-titlebars
dev/migrie/b/12911-wpf-focus-fg
dev/migrie/titebar-colors
dev/lhecker/4015-cursor
dev/migrie/fhl/rgb-rainbow-window-frame
dev/migrie/fhl/scroll-marks-prototype
release-1.12
dev/miniksa/compliance
dev/migrie/f/default-icons
dev/migrie/fhl/10175-web-search-for-text
dev/migrie/fhl/menu-complete-prototype
dev/migrie/b/2988-merged-prototypes
dev/migrie/b/2988-niksa-msgs-prototype
dev/migrie/fhl/9583-colorSelection
dev/migrie/b/10609-sui-leak
dev/migrie/b/32-attempt-3
dev/migrie/release-1.12-rejuv-attempt-2
dev/migrie/demo-for-presentation
dev/migrie/b/32-but-im-here-for-12567
dev/duhowett/conpty_first_frame_blug
dev/migrie/b/11092-unfocused-acrylic-settings
dev/migrie/localtests-in-ci
dev/migrie/b/12356-attempt-2
dev/migrie/b/12353-with-null
dev/migrie/b/12387-trim-spaces
dev/migrie/b/5033-bad-start
dev/lhecker/12351-broken-locales
dev/migrie/b/8663-input-to-oem-crash
dev/migrie/b/11743-win10-opacity-is-hard
dev/migrie/f/ctrl-click-elevate
dev/migrie/b/12196-shim-localization
dev/lhecker/issue-4015-til-rect
dev/cazamor/eim/mvvm
dev/migrie/f/--elevate
dev/migrie/b/11668-i-think
dev/migrie/b/11994-wsl-mangline
dev/migrie/eim/3475-action-xmacros
dev/migrie/eim/incremental-build-000
dev/cazamor/a11y/fake-uia-data
dev/migrie/f/non-terminal-content-elevation-warning
dev/migrie/f/632-on-warning-dialog
dev/lhecker/rgba
dev/migrie/b/8480-keybindings-in-tabs
release-1.11
dev/migrie/b/11561-dead-ends
dev/migrie/oct-21-roadmap-update
dev/migrie/fhl/adaptive-card-extension
dev/cazamor/test/11440
dev/migrie/f/warning-dlg-automation
dev/migrie/b/1.12-crash-on-exit
dev/migrie/b/11146-next-tab-in-cmdpal
release-1.10
dev/migrie/5ff9a24-and-75e2b5f
dev/duhowtt/hax/cpal-jumplist-async
dev/lelian/actionid/1
dev/migrie/f/just-elevated-state
dev/lhecker/terminal-settings-cleanup
dev/migrie/gh-10824
dev/pabhoj/cursor_light
dev/migrie/oop/wandavision
dev/migrie/oop/endgame
dev/migrie/oop/infinity-war
dev/lhecker/app-state-actually-hidden
dev/migrie/b/6160-dynamic-default-warning
dev/mgirie/b/more-nchhittest-ideas
dev/migrie/b/9320-interfacial-separation
cinnamon/fhl/find-contextmenu
dev/lhecker/wsl-distro-generator-cleanup
dev/migrie/b/10875-but-more-clever
dev/migrie/b/broken-globalsummon-overloading
dev/duhowett/hax/rle-row
dev/migrie/fhl-2021/cmdpal-select-list
dev/migrie/fhl-2021/differential-pixel-shading
dev/duhowett/hax/no-writable-glyphat
dev/migrie/fhl-2021/more-shader-variables
dev/migrie/titlebar-shenannigans
dev/miniksa/win10_font_matching
dev/lhecker/conhost-oom
dev/migrie/b/10332-less-snappy-scrolling
dev/migrie/b/7422-1px-top-border
release-1.9
dev/cazamor/move-scratch
release-1.8
dev/miniksa/manifest_2
release-1.6
release-1.7
dev/migrie/oop/the-whole-thing
dev/migrie/oop/connection-factory
dev/migrie/f/quake-dropdown-2
dev/miniksa/rle2
dev/migrie/f/quake-toCurrent-experiments-2
dev/migrie/f/quake-toCurrent-experiments
dev/migrie/f/quake-dropdown
dev/cazamor/actions-page/template
dev/duhowett/hax/cursor_stamp_foreground_background
dev/migrie/f/1860-hey-might-was-well-hack-during-a-hackathon
dev/migrie/oop-terminal.control-split-control
dev/duhowett/hax/build-with-wholearchive
dev/cazamor/spec/tsm-actions-temp
dev/migrie/oop-tear-apart-control
dev/migrie/oop-scratch-3
dev/cazamor/sui/bugfix-reload-crash
dev/migrie/f/xmacro
dev/cazamor/sui/proto/profile-nav-view
dev/migrie/f/name-windows
dev/migrie/dol/messing-with-shaders-take-1
release-1.5
dev/cazamor/sui/inheritance-hyperlinks-test
dev/migrie/r/commandline-lib-002
dev/migrie/f/com.fabrikam.toaster
dev/cazamor/adaptive-cards-prototype
dev/migrie/f/commandline-lib
dev/miniksa/zipzoom2
dev/migrie/f/remote-commandlines
dev/migrie/f/632-elevated-profiles
dev/migrie/oop-broker-000
dev/migrie/fix-pr-7015
dev/duhowett/clang
dev/miniksa/input_tests_2
dev/miniksa/input2
dev/migrie/oop-rpc-000
release-1.4
dev/migrie/oop-mixed-elevation-1
dev/migrie/oop-window-content-1
cinnamon/open-json
dev/miniksa/input_tests
dev/duhowett/hax/tsm-graphviz
dev/miniksa/input
dev/duhowett/hax/caption_buttons
release-1.3
dev/cazamor/a11y/expand-line-under-viewport
dev/cazamor/acc/ch/word-nav-perf
dev/cazamor/spec/settings-ui-architecture-draft
dev/duhowett/hax/tap_upgrade
dev/migrie/f/pane-exit-animation
release-1.2
dev/migrie/move-lib-up-and-dll-down
release-1.1
dev/migrie/f/branch-2-backup
dev/migrie/f/settings-getters-only
dev/duhowett/hax/command_palette_search
dev/migrie/f/6856-let-terminalpage-expandcommands
dev/migrie/f/theming-2020
dev/migrie/oop-scratch-4
dev/duhowett/hax/punchout
dev/migrie/s/action-ids
dev/migrie/f/lets-just-generate-these
dev/migrie/oop-scratch-2
dev/miniksa/dcomp
dev/miniksa/gotta_go_fast_spsc
dev/miniksa/gotta_go_fast
dev/miniksa/perf_skip_checks
dev/miniksa/perf_buffer_dig
dev/migrie/s/1203-cursorTextColor
dev/migrie/f/fix-intellisense-i-guess-backup
release-1.0
dev/migrie/f/execute-commandlines
dev/migrie/f/2046-Command-Palette-v2
dev/migrie/b/6421-passthrough-alt
dev/migrie/b/moving-focus-is-hard
dev/miniksa/set
dev/migrie/f/1203-phase-1
dev/migrie/f/get-localtests-in-ci
dev/cazamor/drag-panes
dev/cazamor/tile-background
release-0.11
dev/duhowett/dev/duhowett/hax/appstate_remember
dev/duhowett/hax/wpf_win_8_hax
dev/migrie/b/3088-weird-exact-wrap-resize
release-0.10
dev/migrie/b/4591-custom-scaling-bug
dev/duhowett/hax/attr_smuggling
dev/migrie/b/5161-mingw-vim-fix
dev/miniksa/dx_bitmap
dev/migrie/b/1503-try-messing-with-cooked-read
dev/duhowett/eyebeam
dev/migrie/b/5113-experiments
dev/duhowett/hax-selection-exclusive
dev/migrie/f/more-vt-renderer-tracing
dev/miniksa/bitmap
dev/duhowett/wprp
dev/miniksa/bitmap-mad-with-power
dev/migrie/f/resize-quirk
dev/migrie/f/reflow-buffer-on-resize-002
wpf-renderer-revert
dev/miniksa/draw
release-0.9
dev/miniksa/tabs-color-fix
dev/miniksa/4309
dev/migrie/f/just-wrapping
dev/migrie/b/3490-try-another-resize-algo
release-0.8
dev/migrie/b/3490-a-simpler-resize
dev/migrie/b/3490-resize-down
dev/miniksa/4254
dev/migrie/f/conpty-wrapped-lines-2
dev/migrie/b/be-better-at-hiding
dev/migrie/f/3327-xaml-theming-proto
dev/miniksa/gardening2
release-0.7
dev/duhowett/conpty-flags
dev/migrie/f/603-vintage-opacity
dev/migrie/PR#3181-comments
dev/duhowett/font-64
release-0.5
dev/migrie/b/663-paste-lf-always
dev/migrie/b/2011-reordered-fallthrough-strings
dev/migrie/b/411-init-tab-stops
dev/migrie/b/json-patching-is-hard
dev/migrie/b/2455-try-getting-tests-working
dev/migrie/b/1223-change-256-table
dev/migrie/f/2171-openterm.cmd
dev/migrie/f/drag-panes
dev/migrie/f/2046-command-palette
release-0.3
dev/miniksa/manager
dev/migrie/f/non-terminal-panes
dev/migrie/f/passthrough-2019
dev/miniksa/shared_pch
dev/migrie/f/1897-less-duplicated-work
release-0.2
dev/cazamor/mcs/viewport-selection
dev/duhowett/version_hack
v1.25.1912.0
v1.24.11911.0
v1.25.1322.0
v1.24.11321.0
v1.25.1241.0
v1.25.1171.0
v1.25.923.0
v1.24.10921.0
v1.25.622.0
v1.24.10621.0
v1.24.10212.0
v1.23.20211.0
v1.24.3504.0
v1.23.13503.0
v1.24.2812.0
v1.23.12811.0
v1.24.2682.0
v1.23.12681.0
v1.24.2372.0
v1.23.12371.0
v1.23.12102.0
v1.22.12111.0
v1.23.11752.0
v1.22.11751.0
v1.22.11141.0
v1.23.11132.0
v1.23.10732.0
v1.22.10731.0
v1.21.10351.0
v1.22.10352.0
v1.23.10353.0
v1.22.3232.0
v1.21.3231.0
v1.22.2912.0
v1.21.2911.0
v1.22.2702.0
v1.21.2701.0
v1.22.2362.0
v1.21.2361.0
v1.21.1772.0
v1.20.11781.0
v1.21.1382.0
v1.20.11381.0
v1.21.1272.0
v1.20.11271.0
v1.20.11215.0
v1.19.11213.0
v1.20.10822.0
v1.19.10821.0
v1.20.10572.0
v1.19.10573.0
v1.20.10303.0
v1.19.10302.0
v1.18.10301.0
v1.20.10293.0
v1.19.10292.0
v1.18.10291.0
v1.18.3181.0
v1.19.3172.0
v1.19.2831.0
v1.18.2822.0
v1.19.2682.0
v1.18.2681.0
v1.18.1462.0
v1.17.11461.0
v1.18.1421.0
v1.17.11391.0
v1.17.11043.0
v1.16.10261.0
v1.17.1023
v1.16.10231.0
v1.15.3465.0
v1.16.3463.0
v1.15.2712.0
v1.15.2874.0
v1.16.2641.0
v1.16.2523.0
v1.15.2524.0
v1.15.2282.0
v1.14.2281.0
v1.14.1962.0
v1.15.2002.0
v1.15.2001.0
v1.15.1862.0
v1.14.1861.0
v1.14.1451.0
v1.14.1432.0
v1.13.11431.0
v1.13.10983.0
v1.12.10982.0
v1.13.10733.0
v1.12.10732.0
v1.13.10395.0
v1.12.10393.0
v1.13.10336.0
v1.12.10334.0
v1.12.3472.0
v1.11.3471.0
v1.12.2931.0
v1.12.2922.0
v1.11.2921.0
v1.11.2731.0
v1.10.2714.0
v1.11.2421.0
v1.10.2383.0
v1.10.1933.0
v1.9.1942.0
v1.9.1523.0
v1.8.1521.0
v1.9.1445.0
v1.8.1444.0
v1.8.1092.0
v1.7.1091.0
v1.8.1032.0
v1.7.1033.0
v1.7.572.0
v1.6.10571.0
v1.5.10411.0
v1.6.10412.0
v1.6.10272.0
v1.5.10271.0
v1.5.3242.0
v1.4.3243.0
v1.5.3142.0
v1.4.3141.0
v1.4.2652.0
v1.3.2651.0
v1.3.2382.0
v1.2.2381.0
v1.1.2233.0
v1.2.2234.0
v1.1.2021.0
v1.2.2022.0
v1.1.1812.0
v1.0.1811.0
v1.1.1671.0
v1.0.1401.0
v0.11.1333.0
v0.11.1251.0
v0.11.1191.0
v0.11.1111.0
v0.11.1121.0
v0.10.781.0
v0.10.761.0
v0.9.433.0
v0.8.10261.0
v0.8.10091.0
v0.7.3451.0
v0.7.3382.0
v0.7.3291.0
v0.7.3252.0
v0.6.3181.0
v0.6.2951.0
v0.6.2911.0
v0.5.2762.0
v0.5.2761.0
v0.5.2681.0
v0.5.2661.0
v0.3.2321.0
v0.4.2342.0
v0.4.2382.0
v0.3.2171.0
v0.3.2142.0
v0.2.1831.0
v0.2.1715.0
v0.2.1703.0
v0.1.1621.0
v0.1.1581.0
v0.1.1502.0
v0.1.1431.0
v0.1.1361.0
v0.1.1093.0
v0.1.1161.0
v0.1.1204.0
experiment-master
v0.1.1025.0
experiment-OutsideBuild
broken-tabstops
RS2-final
v0.1.1002.0
experiment-rel-windows-inbox
experiment-f-ServerApp
v0.1.1211.0
1904.29002
1810.02002
1708.14008
Labels
Clear labels
⛺ Reserved
A11yCO
A11yMAS
A11ySev1
A11ySev2
A11ySev3
A11yTTValidated
A11yUsable
A11yVoiceAccess
A11yWCAG
Area-Accessibility
Area-AtlasEngine
Area-AzureShell
Area-Build
Area-Build
Area-Chat
Area-CmdPal
Area-CodeHealth
Area-Commandline
Area-CookedRead
Area-DefApp
Area-Extensibility
Area-Fonts
Area-GroupPolicy
Area-i18n
Area-Input
Area-Interaction
Area-Interop
Area-Localization
Area-Output
Area-Performance
Area-Portable
Area-Quality
Area-Remoting
Area-Rendering
Area-Schema
Area-Server
Area-Settings
Area-SettingsUI
Area-ShellExtension
Area-ShellExtension
Area-ShellExtension
Area-Suggestions
Area-Suggestions
Area-TerminalConnection
Area-TerminalControl
Area-Theming
Area-UserInterface
Area-VT
Area-Windowing
Area-WPFControl
AutoMerge
Blocking-Ingestion
Culprit-Centennial
Culprit-WinUI
Disability-All
Disability-Blind
Disability-LowVision
Disability-Mobility
External-Blocked-WinUI3
Fixed
Gathering-Data
good first issue
HCL-E+D
HCL-WindowsTerminal
Help Wanted
Impact-Compatibility
Impact-Compliance
Impact-Correctness
Impact-Visual
In-PR
InclusionBacklog
InclusionBacklog-Windows TerminalWin32
InclusionCommitted-202206
Issue-Bug
Issue-Docs
Issue-Feature
Issue-Feature
Issue-Question
Issue-Samples
Issue-Scenario
Issue-Task
Needs-Attention
Needs-Author-Feedback
Needs-Bisect
Needs-Discussion
Needs-Repro
Needs-Tag-Fix
Needs-Tag-Fix
Needs-Triage
No-Recent-Activity
Priority-0
Priority-1
Priority-2
Priority-3
Product-Cmd.exe
Product-Colortool
Product-Colortool
Product-Colortool
Product-Conhost
Product-Conpty
Product-Meta
Product-Powershell
Product-Terminal
Product-WSL
pull-request
Resolution-Answered
Resolution-By-Design
Resolution-Duplicate
Resolution-External
Resolution-Fix-Available
Resolution-Fix-Committed
Resolution-No-Repro
Resolution-Won't-Fix
Severity-Blocking
Severity-Crash
Severity-DataLoss
spam
this-will-be-a-breaking-change
Tracking-External
WindowsTerminal_Win32
Work-Item
zAskModeBug
zInbox-Bug
Mirrored from GitHub Pull Request
Milestone
No items
No Milestone
Projects
Clear projects
No project
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: starred/terminal#580
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @JFLarvoire on GitHub (Mar 12, 2019).
Originally assigned to: @miniksa on GitHub.
Your Windows build number: (Type
verat a Windows Command Prompt)Microsoft Windows [Version 10.0.18342.8]
(But this happens on all versions of Windows since at least Windows 7.)
What you're doing and what's happening: (Copy & paste specific commands and their output, or include screen shots)
In the cmd.exe console, set to code page 65001, type a large UTF-8 file containing hundreds of short lines with just the characters "ü€ü€ü€ü€ü€"
What's wrong / what should be happening instead:
95% of the lines are displayed correctly, but about 5% contain spurious characters. Ex: "ü���ü€ü€ü€ü€"
This happens with any application, not just cmd.exe's built-in TYPE command. So I suspect this is a bug in the UTF-8 to Unicode conversion routine in the console output handler.
For more details, and files and scripts for reproducing it, see the discussion thread on this forum: https://www.dostips.com/forum/viewtopic.php?f=3&t=9017
@zadjii-msft commented on GitHub (Mar 12, 2019):
I've filed this internally as MSFT:20812701 to make sure this gets looked at. Thanks for the report!
@german-one commented on GitHub (Mar 12, 2019):
Seems there is a buffer in place that causes this bug. If the buffer is filled but the bytes read end somewhere inside of a multi-byte UTF-8 character then the conversion of this buffer end fails and the conversion routine puts as many Unicode replacement characters in the output buffer as invalid bytes were at the end of the buffer. The same will happen with the next chunk that begins with the bytes left from the last multi-byte character of the former chunk. The example above shows three replacement characters which is the number of bytes the € sign takes in a UTF-8 character.
@german-one commented on GitHub (Mar 12, 2019):
In the hope that this will help to fix the issue I offer a minimalist C code that works around it. The code takes care of character boundaries. (In addition it discards the Byte Order Mark which is a different issue.)
In a CMD prompt you may use it like that:
@german-one commented on GitHub (Mar 14, 2019):
I updated the test code above. Please see my comments related to the OUT_PROC macro.
It seems to prove that the application is the culprit rather than the console. As long as the application takes care of character boundaries the console does process UTF-8 correctly. I get the same results using both the new console and the legacy console.
@DHowett-MSFT commented on GitHub (May 18, 2019):
@miniksa This is a lot like what we saw with CMD and WSL bringing up emoji for the build demo. Marking as a bug.
@german-one commented on GitHub (May 18, 2019):
@DHowett-MSFT May I ask you - In case of emojis split UTF-16 surrogates, I guess?
@DHowett-MSFT commented on GitHub (May 21, 2019):
That's possible. There's also a chance that we are getting the 3-byte UTF-8 encoded emoji in two parts from the application.
@german-one commented on GitHub (May 21, 2019):
I'm convinced you guys from the terminal/console team are nice and will work around that kind of faulty input from an application, right? 😃
@DHowett-MSFT commented on GitHub (May 21, 2019):
As best we can!
@miniksa commented on GitHub (May 21, 2019):
I'm taking this because it feels similar to some of the other bugs I have assigned to me talking about U+FFFD.
@DHowett-MSFT commented on GitHub (May 25, 2019):
Even if there's an issue in conhost, I'm convinced there's an issue in Terminal as well.
4c47631bf4/src/cascadia/TerminalConnection/ConhostConnection.cpp (L188-L190)We are absolutely cutting UTF-8 sequences in half right there.
We can do fun games and cache partial sequences (partial code below), but it does add complexity.
It's probably necessary complexity!
I hacked it up to write
0123over the lead bytes where we cut off the ends of partial sequences, andABCDover the trail bytes where we cut off the beginnings of partial sequences, and we get this:(you can see where one
ReadFileended and the next began where we transitioned from numbers to letters.)It wouldn't be strictly easier to just
ReadFileuntil we got a complete UTF-8 codepoint because we would still need to figure out when we didn't have a complete codepoint.@german-one commented on GitHub (May 25, 2019):
@DHowett-MSFT
Sorry for my ignorance but I don't understand this statement. Correct me if I'm wrong but passing a string that contains an incomplete codepoint to any other function causes an additional risk (just like
to_hstring()irreversibly corrupts the string in the current code). Wouldn't it be always better to make sure you forward only complete codepoints from the early beginning?@DHowett-MSFT commented on GitHub (May 25, 2019):
Sorry, that’s what this proposal is! When we encounter an incomplete codepoint we need to wait for the next trip around the I/O loop to complete it. We can still send everything up to but not including the incomplete codepoint.
My statement about
ReadFilewas moreso that it is safer/easier to cache the partial data and wait for the next read loop instead of trying to expand the buffer and read a couple more bytes immediately.@DHowett-MSFT commented on GitHub (May 26, 2019):
This is almost certainly the right place to use @adiviness's
Utf8ToWideCharParser!4c47631bf4/src/host/utf8ToWideCharParser.hpp (L5-L14)To be done:
host/totypes/(check dependencies first)O(N)) that U8tWCP does; we only need to check the last 3 bytes of the string for longer-than-will-fit sequencesO(N))@german-one commented on GitHub (May 26, 2019):
I was about to write a piece of code when I saw you already have a parser. But now that you added some more notes I finished it in the hope it is a little helpful.
It also still addresses the BOM issue (blank that appears in the first screen shot). Please tell me if you want me to report it separately.
Attached you'll find a testing environment with the compiled app.
NormalizeUTF8.zip
EDIT: Code and attachment updated.
EDIT 2: VT Processing enabled for additional tests
@german-one commented on GitHub (Jun 8, 2019):
I updated the latest test code again (with VT Processing enabled) in order to see how it might be related to the occurrence of � (Unicode Replacement Character U+FFFD) as they appear in #455 and #666.

For that reason I've stolen @PhMajerus ' test pattern, converted it to UTF-8, and attached it to the above ZIP archive.
TYPE only:
Piped to the test code:

The replacement characters don't appear at the same positions as in the linked issues. But I guess this is due to different sizes of character buffers in the Console and Terminal source codes.
@german-one commented on GitHub (Jun 30, 2019):
It was not too hard to update the function that @DHowett-MSFT quoted in https://github.com/Microsoft/terminal/issues/386#issuecomment-495822626
Unfortunately this doesn't seem to be the only function that has to be updated because it isn't sufficient to close this issue yet.
Could you guys point me to more source files that are worth to review? I'd like to contribute but for me it's a mess to figure out where I have a chance to find the culprit.
@miniksa commented on GitHub (Jul 2, 2019):
Uhhhh, what's still wrong after your proposed test change? That would help me better narrow down which files might still be suspect.
If you're looking inside the console host for problems, I'd personally breakpoint on the
WriteConsole*methods inside_stream.cppand chase them around the code to see how the segments of text received off of the APIs are being handled.(I think you're trying to fix the console host side given the screenshots above of just CMD.exe in a plain conhost window.)
@german-one commented on GitHub (Jul 2, 2019):
Thanks you @miniksa
The screenshots above have been made before I forked the source code. So, yes that was of course for conhost only. The function that @DHowett-MSFT quoted and that I tried to update is the interface between terminal and conhost (at least that's my poor understanding of how it is linked together, correct me if I'm wrong). You can find it in this commit:
ea46579794Well, nothing changed yet. I didn't expect that this would already close this issue because the buffer size in this function is 4096 bytes but the U+FFFD character appears more often. I suspect there is a much smaller buffer involved somewhere else. However, the update also includes the BOM removal. And at least that is what I expected to see.
Some more screenshots might be helpful.
... nor PowerShell 6.

Neither as stand-alone nor in the terminal.

Ubuntu bash has a problem with the BOM (as Linux has in general).


CMD fails entirely. For completeness again in the default conhost ...

... and with the updated code.


At least in the last screenshot I would have expected that the BOM doesn't appear anymore (blank on the top left corner of the pattern).
FWIW the misaligned text ".majerus.net/" is not related to my update. Probably another issue.
I'll try my best.
Steffen
@miniksa commented on GitHub (Jul 2, 2019):
Oh. The difference between Powershell/PWSH, CMD, and WSL is that they're likely all using different Write* method entrypoints.
I forget which is which, but they're probably using a selection of
WriteConsoleA,WriteConsoleW,WriteConsoleOutputA,WriteConsoleOutputW,WriteFile(which should be serviced the same asWriteConsoleA).The post-API-decoding-calls should be findable by searching the code for
ApiRoutines::WriteConsoleAImpland friends.It's probably that CMD is using one and the others are using others and the one that CMD is using is broken somehow.
The other thing to watch out for is whether they're calling
SetConsoleCPorSetConsoleOutputCP. It's likely/probable that Powershell, PWS, and WSL are either setting the codepage to 65001 (UTF-8) and using the A versions of the APIs OR using the W versions of the APIs with UTF-16 text directly.But CMD.exe doesn't usually do any of that. It's probably using whatever codepage the system is in and writing everything into the A API without thinking about it.
@german-one commented on GitHub (Jul 2, 2019):
Yes I'm aware of that fact. If you look at the prompts in my screenshots you'll see that I always have to use
chcp 65001in the cmd.exe instances. Otherwise you would see the character representation of every single byte in the default OEM codepage.WriteConsoleAImplis certainly a good point to look at. It involves theUtf8ToWideCharParserclass where I don't expect to find the culprit. The member functions of the class useMultiByteToWideCharto check if all code points are valid and to convert the UTF-8 buffer to UTF-16. All good so far. I expect that the culprit is the caller ofWriteConsoleAImpl. My test code proves that UTF-8 itself is not a real problem. But if the caller pass chunks containing partial code points (which is what I correct in my test code) then it might be already too late for the API to work around that issue. Imo we would need a static cache for the partials inWriteConsoleAImpl. But I'm not sure if that would cause more issues. If we have a static cache, would this influence concurrent calls from other processes? Or owns every process an independent instance of the function?@german-one commented on GitHub (Jul 2, 2019):
Um ... wait ... we already have a
staticinstance ofUtf8ToWideCharParserinWriteConsoleAImpl. That answers my question and I need to have a closer look atUtf8ToWideCharParser.@miniksa commented on GitHub (Jul 2, 2019):
There cannot be concurrent calls in that we cannot service two calls at the exact same time because they're queued and the console is locked.
However, there can be concurrent calls in that Process A can write a partial fragment, then Process B's request is the next in queue and can write some other unrelated fragment, then Process A is next to write its remainder. So a static cache will leave some sort of hole in the quest for a perfect solution.
However, I'm pretty sure
Utf8ToWideCharParserright now ignores this problem and effectively IS a static cache for the partials when the codepage is set to 65001.There is also another static cache for other codepages called
WriteConsoleDbcsLeadBytehanging off of theSCREEN_INFORMATIONclass that is supposed to hold the first half of a split double-byte sequence (for codepages like 932).That's been that way for decades and is probably why we ignored the concurrence problem when writing
Utf8ToWideCharParserin the more recent era.The caller of
WriteConsoleAImplcan be found in theserverlibrary, but that library is basically just decoding the entire API packet as it receives it. It will callWriteConsoleAImplonce with the entire contents of the packet that it received from the calling process. So if anyone's tearing bytes in half, it should be the caller on the other end.But
Utf8ToWideCharParserandWriteConsoleDbcsLeadByteare supposed to handle that torn state for 65001 and other code pages respectively already.@german-one commented on GitHub (Jul 2, 2019):
We posted at the same time 😀 I didn't see the static declaration in the first place. However, thanks for the explanation and insight.
Yes, that's exactly what I believe is the reason for this problem. See what I did in my test code. If conhost gets the the data directly from cmd.exe (using its internal TYPE command) then we are facing this issue. If the same data is piped to my test app which takes care of incoming partials, and conhost gets chunks of data from the test app that don't contain partials anymore, then you don't have this problems anymore. So, the actual question is whether or not conhost is supposed to work around the deficiencies of applications like cmd.exe 😉 It would be nice, no doubt.
@german-one commented on GitHub (Jul 3, 2019):
Update:
I was not able to find anything wrong in
Utf8ToWideCharParser. Thus, I banned it entirely fromWriteConsoleAImpland implemented my own quick and dirty UTF-8 handling. Result was that nothing changed for the CMD output. But the BOM is getting removed in the WSL output.@miniksa What do you think? Is the BOM removal something that should be included into the
Utf8ToWideCharParserclass? My expectation is that the BOM should not show up in the output. But on the other hand \EF \BB \BF shall be treated as BOM only if it is the beginning of the stream.Next step for me is to review
WriteConsoleOutputCharacterAImplin _output.cpp. There is a real good chance to find the culprit 😀😀 It callsConvertToWin convert.cpp. This function converts the incoming chunk to UTF-16 without any check for partial code points. I'll let you know ...@miniksa commented on GitHub (Jul 3, 2019):
I'm of two minds on the BOM thing.
The first is that it's impossible to tell really what is the beginning of stream without some heuristics or further state on when a process connected and if it's the first thing that it has said. Probably more complicated than we want to deal with.
The second is that I can't think of a valid use for echoing a BOM to a Console/Terminal in the slightest and we should probably just wholesale discard them even though we should technically only do that as the "start of stream" rule. But instead of discarding them here, I think I'd rather pass it along further in the
Utf8ToWideCharParserportion of the class and let theTextBuffertreat the BOM as a control character that "does nothing" than to strip it out in the parser layer. I have an agenda item on me to effectively add aWriteStreammethod to theTextBufferto attempt to supercede bothWriteCharsLegacyin conhost.exe and theWriteCharsLegacy2ElectricBoogaloomethod in windowsterminal.exe. Those methods are basically responsible for stripping controls and performing an action anyway so it seems like an apt location to put something like this.In short, leave the BOM alone for now and we'll revisit.
For the other part, GOOD CALL. You're right, the
WriteConsoleOutputCharacterAmethod is likely doing things quite differently withConvertToW. I always wanted to reconcile how the cell-write methods (OutputCharacter/OutputAttribute) worked versus the stream-write methods (Output) in terms of codepage conversion, but we never got to that. I forgot about that one when I was writing this yesterday. Hope you find something fruitful there and thank you for continuing to dig into this!@german-one commented on GitHub (Jul 3, 2019):
Thanks for your advice regarding the BOM.
Unfortunately updating the
WriteConsoleOutputCharacterAfunction still didn't resolve the CMD issue. Meanwhile I'm wondering if CMD.exe determines the file type of the standard output handle, and in case it is conhost, it converts the stream to UTF-16 internally. In this case I'm afraid we are out of luck.I think I should write another small test app that does nothing but forwarding the piped stream from cmd.exe in order to investigate how it behaves.
@german-one commented on GitHub (Jul 3, 2019):
CMD.exe is an evil beast 👹
another test code:
It just reads from standard input and uses
WriteConsoleOutputCharacterA,WriteConsoleA, orWriteFileto write to standard output (I compiled 3 versions). The tool returns the number of write operations.Note that I used a buffer of 8192 bytes while the test pattern has a size of only 6642 bytes. I tested using the default conhost (no updated functions involved).
This screenshot shows that
ConsoleOutputCharacterAcan't be the reason for the faulty output. It is not even able to process Line Feed characters to wrap the lines. VT escape sequences are ignored, too. (I still believe that the function should be updated for UTF-8 partials though.)It was written in 2 steps . No idea if CMD forwards the stream in two steps, if the involved pipe can't process all of the 6642 bytes at once, or if ReadFile has a limitation.
WriteConsoleAsuccessfully writes the buffer read. Still with BOM as expected.WriteFilebehaves the same.@miniksa My conclusion is that CMD.exe detects the file type (likely using
GetFileType). If the type isFILE_TYPE_CHARthen it internally converts UTF-8 to UTF-16 and uses one of the ...W functions to write the output. Unless you have any further idea I'm afraid you can close this issue without having a solution, since CMD.exe is out of scope and as you guys explained several times you won't update it anymore.However, apparently there are some functions that should be updated even if these updates are not able to resolve the CMD.exe issues. Any advice on how to proceed?
@miniksa commented on GitHub (Jul 5, 2019):
Yes. Very yes.
I wouldn't be surprised if it was converting. I can try to spend like 5 minutes on checking if this is true by reading the internal source for CMD.exe on Monday when I get back into work, but it's not worth spending much time on because we can't really fix anything in CMD without breaking the world.
Start a PR anyway with the proposed fixes to the other functions referencing this issue. It's OK if we only fix part of it.
@german-one commented on GitHub (Jul 5, 2019):
I didn't want to ask you. I know you have limited time for things like that. However, I think it would be necessary to make sure my assumptions are correct and to close this issue.

Unfortunately I can't just disassemble CMD.exe to figure it out because I don't speak Assembly. But I can check if the expected functions are dynamically linked:
And they are ... 😉
Okay I will spend some hours on the weekend to prepare it and do some tests.
Actually only two functions are left.
ConhostConnection::_OutputThread()I think I'll leave my current fix including BOM removal because it seems to me that the function reads from the beginning of the stream.
ApiRoutines::WriteConsoleOutputCharacterAImplHere I'll try to get advantage of
Utf8ToWideCharParser. Do you think I should try to include the DBCS handling like inWriteConsoleAImpl? I'm afraid I can't test it properly though 😟@german-one commented on GitHub (Jul 6, 2019):
@miniksa
I'll start a PR for
_OutputThreadonly.WriteConsoleOutputCharacterAImplneeds more considerations and agreements with you. For that reason I will refrain from further scope creeping in this thread and rather open a new issue.@PhMajerus commented on GitHub (Jul 8, 2019):
That misaligned text ".majerus.net/" is just a terminal hyperlink on the ANSI logo using an ESC]8 control sequence. Conhost and Terminal both properly ignore it as they don't support hyperlinks yet.
It's probably related to the same issue, UTF-8 encoding of some C0 control character gets broken, making the escape sequence impossible to parse properly and some of it gets shown instead of ignored.
@german-one commented on GitHub (Jul 8, 2019):
Kind of. The terminal does not entirely ignore it as it seems. I believe it's a matter of window updating. As soon as I resize the window (e.g. from maximized to normal) this remnant disappears miraculously.
@eryksun commented on GitHub (Dec 30, 2019):
CMD only uses the console's wide-character API for console I/O, at least back to NT 4 in 1996, and probably all the way to NT 3.1. It does use the current console output codepage, but only indirectly. It uses it by default for encoding output written to disk files and pipes, and for decoding input read from files such as a line from a batch script or a line from the pipe in a
for /floop.@zadjii-msft commented on GitHub (Jan 4, 2022):
I'm closing this since it was largely fixed by #1850, and the follow-up discussion is tracked in #1851. Thanks again everyone!
@german-one commented on GitHub (Jan 5, 2022):
People who are still coming across this topic: The initial post describes a behavior which is almost certainly a bug in cmd.exe. It seems to convert the read UTF-8 chunks with lacerated code points and in the consequence writes ruined UTF-16. No terminal application can heal it anymore. Thus, a fix for #1851 won't ever fix this.