Code change:
for (( i=0; i < "${#str}"; ++i )); do byte="${str:$i:1}" <del> # Escape backslashes, semi-colons specially, then special ASCII chars below space (0x20) </del> <ins> # Escape backslashes, semi-colons specially, then special ASCII chars below space (0x20). # This is done in an unwrapped loop instead of using printf as the latter is very slow. </ins> if [ "$byte" = "" ]; then token="" elif [ "$byte" = ";" ]; then token="x3b" <del> elif (( $(builtin printf '%d' "'$byte") < 31 )); then token=$(builtin printf 'x%02x' "'$byte") </del> <ins> elif [ "$byte" = $'x00' ]; then token="x00" elif [ "$byte" = $'x01' ]; then token="x01" elif [ "$byte" = $'x02' ]; then token="x02" elif [ "$byte" = $'x03' ]; then token="x03" elif [ "$byte" = $'x04' ]; then token="x04" elif [ "$byte" = $'x05' ]; then token="x05" elif [ "$byte" = $'x06' ]; then token="x06" elif [ "$byte" = $'x07' ]; then token="x07" elif [ "$byte" = $'x08' ]; then token="x08" elif [ "$byte" = $'x09' ]; then token="x09" elif [ "$byte" = $'x0a' ]; then token="x0a" elif [ "$byte" = $'x0b' ]; then token="x0b" elif [ "$byte" = $'x0c' ]; then token="x0c" elif [ "$byte" = $'x0d' ]; then token="x0d" elif [ "$byte" = $'x0e' ]; then token="x0e" elif [ "$byte" = $'x0f' ]; then token="x0f" elif [ "$byte" = $'x10' ]; then token="x10" elif [ "$byte" = $'x11' ]; then token="x11" elif [ "$byte" = $'x12' ]; then token="x12" elif [ "$byte" = $'x13' ]; then token="x13" elif [ "$byte" = $'x14' ]; then token="x14" elif [ "$byte" = $'x15' ]; then token="x15" elif [ "$byte" = $'x16' ]; then token="x16" elif [ "$byte" = $'x17' ]; then token="x17" elif [ "$byte" = $'x18' ]; then token="x18" elif [ "$byte" = $'x19' ]; then token="x19" elif [ "$byte" = $'x1a' ]; then token="x1a" elif [ "$byte" = $'x1b' ]; then token="x1b" elif [ "$byte" = $'x1c' ]; then token="x1c" elif [ "$byte" = $'x1d' ]; then token="x1d" elif [ "$byte" = $'x1e' ]; then token="x1e" elif [ "$byte" = $'x1f' ]; then token="x1f" </ins> else token="$byte" fi

Related discussion:
text: Type: <bBug</bterminal git bash Enter and you will get delay VS Code version: Code - Insiders 1.90.0-insider (, 2024-05-06T08:07:13.626Z) OS version: WindowsNT x64 10.0. Modes: <details<summarySystem Info</summary </details<details<summaryExtensions (42)</summaryExtensionVersion ------ rust-bundle1.0.0 glance0.0.8 project-manager12.8.0 redmodscript-lang0.2.0 redmodtweak-lang0.1.0 lit-html1.11.1 glsl-literal1.0.6 vscode-markdownlint0.55.0 vscode-eslint2.4.4 composer-php-vscode1.45. intelli-php-vscode0.12. phptools-vscode1.45. profiler-php-vscode1.45. rust-syntax0.6.1 gitlens14.9.1 EditorConfig0.16.4 prettier-vscode10.4.0 auto-close-tag0.5.15 auto-rename-tag0.1.10 copilot1.186.856 copilot-chat0.16. todo-tree0.0.226 path-autocomplete1.25.0 redscript-syntax-highlighting0.0.3 auto-comment-blocks1.0.1 dotenv1.0.1 debugpy2024.6.0 python2024.6.0 vscode-pylance2024.4.1 remote-wsl0.88.2 hexeditor1.10.0 vscode-extension-auto-import1.4.3 indent-rainbow8.3.1 vscode-yaml1.14.0 rust-analyzer0.3.1950 crates0.6.6 shader1.1.5 vscode-styled-components1.7.8 vscode-stylelint1.4.0 vscode-mdx1.8.4 highlight-matching-tag0.11.0 vscode-import-cost3.3.0 (1 theme extensions excluded) </details<details<summaryA/B Experiments</summary</details<!-- generated by issue reporter --
does this reproduce if you disable shell integration, ?
If I uncheck Shell Integration, it works well after terminal restart.
I have more details in with what's going wrong.