Cannot paste "─" character in WSL #10177

Closed
opened 2026-01-31 02:14:28 +00:00 by claunia · 15 comments
Owner

Originally created by @G-Rath on GitHub (Aug 15, 2020).

Environment

Windows build number: [Version 10.0.18363.1016]
Windows Terminal version (if applicable): 1.1.2021.0

Any other software?

Steps to reproduce

Copy the "─" character and attempt to paste it into WSL in Windows Terminal or conhost.

Expected behavior

The character is pasted fine.

Actual behavior

It is not pasted fine.


This is an odd bug that's really hard to google, so it might not actually be a microsoft/terminal bug? However, I can successfully paste "─" into WSL via the IntelliJ terminal which I believe isn't using terminal/conhost.

I can paste this character fine into cmd, powershell, and pswh (both in Terminal, and in the windows opened by running those commands via Run, which I assume is/means conhost?).

I originally noticed this when copying from the output of audit-app:

┌────────────┬────────────────────────────────────────────────────────────────────┐
│ low        │ Prototype Pollution (#577)                                         │
├────────────┼────────────────────────────────────────────────────────────────────┤
│ Package    │ lodash v3.10.1                                                     │
├────────────┼────────────────────────────────────────────────────────────────────┤
│ Patched in │ >=4.17.5                                                           │
├────────────┼────────────────────────────────────────────────────────────────────┤
│ More info  │ https://npmjs.com/advisories/577                                   │
└────────────┴────────────────────────────────────────────────────────────────────┘

Pasting the above into WSL via Terminal or conhost results in:

┌┬┐
│ low        │ Prototype Pollution (#577)                                         │
├┼┤
│ Package    │ lodash v3.10.1                                                     │
├┼┤
│ Patched in │ >=4.17.5                                                           │
├┼┤
│ More info  │ https://npmjs.com/advisories/577                                   │
└┴┘

This behaviour happens regardless of what program I copy the text from.

Originally created by @G-Rath on GitHub (Aug 15, 2020). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. If this is an application crash, please also provide a Feedback Hub submission link so we can find your diagnostic data on the backend. Use the category "Apps > Windows Terminal (Preview)" and choose "Share My Feedback" after submission to get the link. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ```none Windows build number: [Version 10.0.18363.1016] Windows Terminal version (if applicable): 1.1.2021.0 Any other software? ``` # Steps to reproduce <!-- A description of how to trigger this bug. --> Copy the "─" character and attempt to paste it into WSL in Windows Terminal or conhost. # Expected behavior <!-- A description of what you're expecting, possibly containing screenshots or reference material. --> The character is pasted fine. # Actual behavior <!-- What's actually happening? --> It is not pasted fine. -------- This is an odd bug that's really hard to google, so it might not actually be a microsoft/terminal bug? However, I can successfully paste "─" into WSL via the IntelliJ terminal which I believe isn't using terminal/conhost. I can paste this character fine into cmd, powershell, and pswh (both in Terminal, and in the windows opened by running those commands via Run, which I assume is/means conhost?). I originally noticed this when copying from the output of [`audit-app`](https://github.com/G-Rath/audit-app): ``` ┌────────────┬────────────────────────────────────────────────────────────────────┐ │ low │ Prototype Pollution (#577) │ ├────────────┼────────────────────────────────────────────────────────────────────┤ │ Package │ lodash v3.10.1 │ ├────────────┼────────────────────────────────────────────────────────────────────┤ │ Patched in │ >=4.17.5 │ ├────────────┼────────────────────────────────────────────────────────────────────┤ │ More info │ https://npmjs.com/advisories/577 │ └────────────┴────────────────────────────────────────────────────────────────────┘ ``` Pasting the above into WSL via Terminal or conhost results in: ``` ┌┬┐ │ low │ Prototype Pollution (#577) │ ├┼┤ │ Package │ lodash v3.10.1 │ ├┼┤ │ Patched in │ >=4.17.5 │ ├┼┤ │ More info │ https://npmjs.com/advisories/577 │ └┴┘ ``` This behaviour happens regardless of what program I copy the text from.
Author
Owner

@G-Rath commented on GitHub (Aug 15, 2020):

For me I'm not able to paste it at all - pasting "─" right now into WSL results in nothing. Doing paste twice results in ^V appearing 🤷

Regardless, least that seems to confirm something buggy is going on, and that it's not just my laptop being screwy 😄

@G-Rath commented on GitHub (Aug 15, 2020): For me I'm not able to paste it at all - pasting "─" right now into WSL results in nothing. Doing paste twice results in `^V` appearing 🤷 Regardless, least that seems to confirm *something* buggy is going on, and that it's not just my laptop being screwy 😄
Author
Owner

@DhruvaSambrani commented on GitHub (Aug 15, 2020):

It works for me.
image
Maybe you are using a font that doesn't have the ─ character

@DhruvaSambrani commented on GitHub (Aug 15, 2020): It works for me. ![image](https://user-images.githubusercontent.com/44899822/90309451-69708100-df06-11ea-904b-9044e40e140c.png) Maybe you are using a font that doesn't have the ─ character
Author
Owner

@G-Rath commented on GitHub (Aug 15, 2020):

@DhruvaSambrani I'd think if the font didn't have the character, then either it wouldn't render it at all, or otherwise paste "fine" and the render would be broken:

image

I've not changed the font from the one that ships with Terminal.

What version of powershell are you using in your screenshot?

@G-Rath commented on GitHub (Aug 15, 2020): @DhruvaSambrani I'd think if the font didn't have the character, then either it wouldn't render it at all, or otherwise paste "fine" and the render would be broken: ![image](https://user-images.githubusercontent.com/3151613/90309988-621a9900-df41-11ea-9df7-92b0ec18bef6.png) I've not changed the font from the one that ships with Terminal. What version of powershell are you using in your screenshot?
Author
Owner

@DhruvaSambrani commented on GitHub (Aug 15, 2020):

What version of powershell are you using in your screenshot?

@G-Rath 5.1.19041.1

PowerShell 5: works (all chars are pasted)

Ohhh I see the difference

@DhruvaSambrani commented on GitHub (Aug 15, 2020): > What version of powershell are you using in your screenshot? @G-Rath 5.1.19041.1 > PowerShell 5: works (all chars are pasted) Ohhh I see the difference
Author
Owner

@zadjii-msft commented on GitHub (Aug 17, 2020):

For me I'm not able to paste it at all - pasting "─" right now into WSL results in nothing. Doing paste twice results in ^V appearing 🤷

Well, sounds to me like you're trying to use Ctrl+V to paste - can you confirm that you've got ctrl+v bound to paste in your settings.json?

Also, what application are you trying to paste into? It looks to me like bash and pwsh (v7.0.0) in WSL work just fine:
image

@zadjii-msft commented on GitHub (Aug 17, 2020): > For me I'm not able to paste it at all - pasting "─" right now into WSL results in nothing. Doing paste twice results in `^V` appearing 🤷 Well, sounds to me like you're trying to use <kbd>Ctrl+V</kbd> to paste - can you confirm that you've got ctrl+v bound to paste in your `settings.json`? Also, what application are you trying to paste into? It looks to me like `bash` and `pwsh` (v7.0.0) in WSL work just fine: ![image](https://user-images.githubusercontent.com/18356694/90401014-fa5c6f00-e062-11ea-8b2c-e41ad4a1238e.png)
Author
Owner

@G-Rath commented on GitHub (Aug 17, 2020):

@zadjii-msft I do indeed have it bound as that:

{ "command": "paste", "keys": "ctrl+v" },

This also happens if I try pasting using right-click as well.

In terms of application, I'm using WSL, started both by running wt and wsl (which I believe runs conhost) via Run:

image

image

@G-Rath commented on GitHub (Aug 17, 2020): @zadjii-msft I do indeed have it bound as that: ``` { "command": "paste", "keys": "ctrl+v" }, ``` This also happens if I try pasting using right-click as well. In terms of application, I'm using WSL, started both by running `wt` and `wsl` (which I believe runs conhost) via Run: ![image](https://user-images.githubusercontent.com/3151613/90451043-17667000-e13f-11ea-9fbc-042a369826a8.png) ![image](https://user-images.githubusercontent.com/3151613/90451086-28af7c80-e13f-11ea-8ed4-e261ae3af780.png)
Author
Owner

@zadjii-msft commented on GitHub (Aug 18, 2020):

Oh here's a thought - what keyboard layout are you using? That might help explain why pasting doesn't work in conhost or the Terminal

@zadjii-msft commented on GitHub (Aug 18, 2020): Oh here's a thought - what keyboard layout are you using? That might help explain why pasting doesn't work in conhost or the Terminal
Author
Owner

@G-Rath commented on GitHub (Aug 18, 2020):

afaik the "standard" keyboard layout:

image

image

I say as far as I know as I've seemed to have a little trouble with keyboards on Windows on my new laptop, mainly around the international keyboard, but that presents with IntelliJ's alt +enter not working as it becomes AltGr and so I've confirmed I'm on the US Keyboard when this happens.

I've also reproduced this behaviour happening on my old laptop, which has a very similar setup to my current one (they're roughly the same Windows version, both WinPro, etc).

@G-Rath commented on GitHub (Aug 18, 2020): afaik the "standard" keyboard layout: ![image](https://user-images.githubusercontent.com/3151613/90561037-307d2880-e1f4-11ea-8b6b-9219f7fa91bc.png) ![image](https://user-images.githubusercontent.com/3151613/90561485-e5174a00-e1f4-11ea-9852-bae6a6729d69.png) I say as far as I know as I've seemed to have a little trouble with keyboards on Windows on my new laptop, mainly around the international keyboard, but that presents with IntelliJ's alt +enter not working as it becomes AltGr and so I've confirmed I'm on the US Keyboard when this happens. I've also reproduced this behaviour happening on my old laptop, which has a very similar setup to my current one (they're roughly the same Windows version, both WinPro, etc).
Author
Owner

@eryksun commented on GitHub (Aug 18, 2020):

Can you paste any of the following characters in WSL, with either a regular console window or under Windows Terminal?

Character Ordinal
̀ U+0300
؀ U+0600
܀ U+0700
U+0800
U+0900
U+0a00
U+0b00
U+0c00
U+0d00
U+0e00
U+1400
U+1800
U+1b00
  U+2000
U+2100
U+2200
U+2300
U+2400
U+2500
U+2600
U+2700

In PowerShell 7, in a regular console window or Windows Terminal, can you paste more than one of the above characters as a repeated sequence? For example, does pasting "⌀⌀⌀" work, or does it just paste a single "⌀"? If the latter, does it work correctly after running Remove-Module psreadline?

@eryksun commented on GitHub (Aug 18, 2020): Can you paste any of the following characters in WSL, with either a regular console window or under Windows Terminal? |Character|Ordinal | :-: | --: |̀ |U+0300 ؀|U+0600 ܀|U+0700 ࠀ|U+0800 ऀ|U+0900 ਀|U+0a00 ଀|U+0b00 ఀ|U+0c00 ഀ|U+0d00 ฀|U+0e00 ᐀|U+1400 ᠀|U+1800 ᬀ|U+1b00  |U+2000 ℀|U+2100 ∀|U+2200 ⌀|U+2300 ␀|U+2400 ─|U+2500 ☀|U+2600 ✀|U+2700 In PowerShell 7, in a regular console window or Windows Terminal, can you paste more than one of the above characters as a repeated sequence? For example, does pasting "⌀⌀⌀" work, or does it just paste a single "⌀"? If the latter, does it work correctly after running `Remove-Module psreadline`?
Author
Owner

@G-Rath commented on GitHub (Aug 18, 2020):

I've only tried with ⌀⌀⌀ right now, but that's already gotten interesting results:

No pasting in WSL at all, both WT & conhost.
If I start pwsh.exe in WT via WSL, then pasting doesn't work, but opening a native pwsh tab in WT lets me paste but it only pastes the one character.

Remove-Module psreadline does restore my ability to paste the complete string properly.

I think you're having a similar thought that I had when I opened this: that this is something to do with the fact that they're the '00 codes.

I've not tried all the chars everywhere, but quick testing with the majority confirms I can't paste them in WSL

@G-Rath commented on GitHub (Aug 18, 2020): I've only tried with `⌀⌀⌀` right now, but that's already gotten interesting results: No pasting in WSL at all, both WT & conhost. If I start `pwsh.exe` in WT via WSL, then pasting doesn't work, but opening a native `pwsh` tab in WT lets me paste but it only pastes the one character. `Remove-Module psreadline` does restore my ability to paste the complete string properly. I think you're having a similar thought that I had when I opened this: that this is something to do with the fact that they're the '00 codes. I've not tried all the chars everywhere, but quick testing with the majority confirms I can't paste them in WSL
Author
Owner

@eryksun commented on GitHub (Aug 18, 2020):

It's something peculiar going on with processing those ordinal values. I checked the Unicode data for the characters, and I don't see any pattern based on the character category, bidirectional class, or East-Asian width. The only pattern I see is that it's the first (0th) ordinal in some, but not all, Unicode blocks.

Do the following characters work normally for you?

Character Ordinal
Ā U+0100
Ȁ U+0200
Ѐ U+0400
Ԁ U+0500
U+0f00
က U+1000
U+1100
U+1200
U+1300
U+1500
U+1600
U+1700
U+1900
U+1a00
U+1c00
U+1d00
U+1e00
U+1f00
@eryksun commented on GitHub (Aug 18, 2020): It's something peculiar going on with processing those ordinal values. I checked the Unicode data for the characters, and I don't see any pattern based on the character category, bidirectional class, or East-Asian width. The only pattern I see is that it's the first (0th) ordinal in some, but not all, Unicode blocks. Do the following characters work normally for you? |Character|Ordinal | :-: | --: |Ā|U+0100 |Ȁ|U+0200 |Ѐ|U+0400 |Ԁ|U+0500 |ༀ|U+0f00 |က|U+1000 |ᄀ|U+1100 |ሀ|U+1200 |ጀ|U+1300 |ᔀ|U+1500 |ᘀ|U+1600 |ᜀ|U+1700 |ᤀ|U+1900 |ᨀ|U+1a00 |ᰀ|U+1c00 |ᴀ|U+1d00 |Ḁ|U+1e00 |ἀ|U+1f00
Author
Owner

@G-Rath commented on GitHub (Aug 18, 2020):

Yeah those characters work normally for me :)

@G-Rath commented on GitHub (Aug 18, 2020): Yeah those characters work normally for me :)
Author
Owner

@DHowett commented on GitHub (Aug 21, 2020):

Wow, yeah, this is truly wild. I actually can paste ⌀⌀⌀ in WSL. However, I've seen issues pasting emoji/other unusual characters into my shell that were only resolved by installing my distribution's localization packages and getting full unicode support. zsh was particularly snarky about it, if I'm honest, because it would print out <ffffffff> for every character it was upset about.

I may have to mark this one external, but please feel free to keep the discussion going. If you can't get UTF-8 support going in your shell in WSL, let's hash that out. 😄

@DHowett commented on GitHub (Aug 21, 2020): Wow, yeah, this is truly wild. I actually _can_ paste ⌀⌀⌀ in WSL. However, I've seen issues pasting emoji/other unusual characters into my shell that were only resolved by installing my distribution's localization packages and getting full unicode support. zsh was particularly snarky about it, if I'm honest, because it would print out `<ffffffff>` for every character it was upset about. I may have to mark this one external, but please feel free to keep the discussion going. If you can't get UTF-8 support going in your shell in WSL, let's hash that out. :smile:
Author
Owner

@G-Rath commented on GitHub (Aug 21, 2020):

@DHowett all good on the close - when I opened the issue I was 50/50 expecting this to be how it played out.

In saying that, yeah any help on how to get UTF-8 support going in my shell would be appreciated. I've not done any customizing of shells, and so expected that the defaults provided by Windows included that support - not really sure where to go to next for setting that up 😅

resolved by installing my distribution's localization packages and getting full unicode support

Actually so re-reading I'm guessing the problem is more about that this is a "problem" with Ubuntu, so I should seek out how to setup UTF-8 for that.

Does this mean that Powershell doesn't draw its locale from Windows, but instead has its own localization packages/setup requirements?

@G-Rath commented on GitHub (Aug 21, 2020): @DHowett all good on the close - when I opened the issue I was 50/50 expecting this to be how it played out. In saying that, yeah any help on how to get UTF-8 support going in my shell would be appreciated. I've not done any customizing of shells, and so expected that the defaults provided by Windows included that support - not really sure where to go to next for setting that up 😅 > resolved by installing my distribution's localization packages and getting full unicode support Actually so re-reading I'm guessing the problem is more about that this is a "problem" with Ubuntu, so I should seek out how to setup UTF-8 for that. Does this mean that Powershell doesn't draw its locale from Windows, but instead has its own localization packages/setup requirements?
Author
Owner

@G-Rath commented on GitHub (Feb 27, 2021):

@DHowett I've still not had a lot of luck in getting UTF-8 support working on my terminal, so would appreciate some pointers (and/or links) if you've got them.

I'm sort of hoping this is whats causing some other odd artifacts when using webpack in tmux:

image

The issue seems to be caused by the webpack build output when its being displayed in a side-by-side panel in tmux, and I've got no idea what to look into to investigate further 😅

This is a sample of the raw output from webpack
> nrun.js build
> wp --config configs/prod.ts
⬡ webpack: Build Finished
⬡ webpack: Hash: 1613e18359bcd36420bf
  Version: webpack 4.46.0
  Time: 2221ms
  Built at: 02/27/2021 2:13:33 PM
                                                 Asset       Size  Chunks                         Chunk Names
      static/js/vendors~bundle.943f191e2533493d900d.js    220 KiB       1  [emitted] [immutable]  vendors~bundle
  static/js/vendors~bundle.943f191e2533493d900d.js.map    772 KiB       1  [emitted] [dev]        vendors~bundle
              static/js/bundle.0d283465340a37cdd261.js   3.85 KiB       0  [emitted] [immutable]  bundle
          static/js/bundle.0d283465340a37cdd261.js.map   14.8 KiB       0  [emitted] [dev]        bundle
                                            index.html  708 bytes          [emitted]              
  Entrypoint bundle = static/js/vendors~bundle.943f191e2533493d900d.js static/js/vendors~bundle.943f191e2533493d900d.js.map static/js/bundle.0d283465340a37cdd261.js static/js/bundle.0d283465340a37cdd261.js.map
  [0] multi react-hot-loader/patch ./src/index.tsx 40 bytes {0} [built]
  [2YZa] ./src/index.tsx + 5 modules 19.1 KiB {0} [built]
      | ./src/index.tsx 273 bytes [built]
      | ./src/AppRoot.tsx 388 bytes [built]
      | ./src/components/index.ts 120 bytes [built]
      | ./src/components/Stats.tsx 815 bytes [built]
      | ./src/components/App.tsx 5.05 KiB [built]
      | ./src/components/RenderErrorOverlay.tsx 12.5 KiB [built]
  [AeFk] ./node_modules/@emotion/react/dist/emotion-react.browser.esm.js + 11 modules 52.8 KiB {1} [built]
      |    12 modules
  [Dp36] ./src/services/api.ts 241 bytes {0} [built]
  [Ff2n] ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js + 1 modules 721 bytes {1} [built]
      |    2 modules
  [H2TA] ./node_modules/@material-ui/core/esm/styles/withStyles.js + 68 modules 169 KiB {1} [built]
      |    69 modules
  [wx14] ./node_modules/@babel/runtime/helpers/esm/extends.js + 1 modules 444 bytes {1} [built]
      |    2 modules
      + 89 hidden modules
  Child HtmlWebpackCompiler:
                            Asset      Size  Chunks  Chunk Names
      __child-HtmlWebpackPlugin_0  4.63 KiB       0  HtmlWebpackPlugin_0
      Entrypoint HtmlWebpackPlugin_0 = __child-HtmlWebpackPlugin_0
      [CXGn] ./node_modules/html-webpack-plugin/lib/loader.js!./public/index.html 1.03 KiB {0} [built] 

@G-Rath commented on GitHub (Feb 27, 2021): @DHowett I've still not had a lot of luck in getting UTF-8 support working on my terminal, so would appreciate some pointers (and/or links) if you've got them. I'm sort of hoping this is whats causing some other odd artifacts when using webpack in tmux: ![image](https://user-images.githubusercontent.com/3151613/109370279-87cb2680-7904-11eb-8b25-f47bb351a524.png) The issue seems to be caused by the webpack build output when its being displayed in a side-by-side panel in tmux, and I've got no idea what to look into to investigate further 😅 <details> <summary>This is a sample of the raw output from webpack</summary> ``` > nrun.js build > wp --config configs/prod.ts ⬡ webpack: Build Finished ⬡ webpack: Hash: 1613e18359bcd36420bf Version: webpack 4.46.0 Time: 2221ms Built at: 02/27/2021 2:13:33 PM Asset Size Chunks  Chunk Names static/js/vendors~bundle.943f191e2533493d900d.js 220 KiB 1 [emitted] [immutable] vendors~bundle static/js/vendors~bundle.943f191e2533493d900d.js.map 772 KiB 1 [emitted] [dev] vendors~bundle static/js/bundle.0d283465340a37cdd261.js 3.85 KiB 0 [emitted] [immutable] bundle static/js/bundle.0d283465340a37cdd261.js.map 14.8 KiB 0 [emitted] [dev] bundle index.html 708 bytes  [emitted] Entrypoint bundle = static/js/vendors~bundle.943f191e2533493d900d.js static/js/vendors~bundle.943f191e2533493d900d.js.map static/js/bundle.0d283465340a37cdd261.js static/js/bundle.0d283465340a37cdd261.js.map [0] multi react-hot-loader/patch ./src/index.tsx 40 bytes {0} [built] [2YZa] ./src/index.tsx + 5 modules 19.1 KiB {0} [built] | ./src/index.tsx 273 bytes [built] | ./src/AppRoot.tsx 388 bytes [built] | ./src/components/index.ts 120 bytes [built] | ./src/components/Stats.tsx 815 bytes [built] | ./src/components/App.tsx 5.05 KiB [built] | ./src/components/RenderErrorOverlay.tsx 12.5 KiB [built] [AeFk] ./node_modules/@emotion/react/dist/emotion-react.browser.esm.js + 11 modules 52.8 KiB {1} [built] | 12 modules [Dp36] ./src/services/api.ts 241 bytes {0} [built] [Ff2n] ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js + 1 modules 721 bytes {1} [built] | 2 modules [H2TA] ./node_modules/@material-ui/core/esm/styles/withStyles.js + 68 modules 169 KiB {1} [built] | 69 modules [wx14] ./node_modules/@babel/runtime/helpers/esm/extends.js + 1 modules 444 bytes {1} [built] | 2 modules + 89 hidden modules Child HtmlWebpackCompiler: Asset Size Chunks Chunk Names __child-HtmlWebpackPlugin_0 4.63 KiB 0 HtmlWebpackPlugin_0 Entrypoint HtmlWebpackPlugin_0 = __child-HtmlWebpackPlugin_0 [CXGn] ./node_modules/html-webpack-plugin/lib/loader.js!./public/index.html 1.03 KiB {0} [built] ``` </details>
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#10177