When writing a command with pipe character for output/input redirect I get the broken-vertical-line (or broken-verical-pipe) character instead of the solid-vertical-line character (the typical pipe). The shell doesn't interpret the typed character properly, hence getting errors from my commands.

I have a standard EN/US Keyboard on my laptop, without numkeys. The environment is WSL2 (Windows Subsystem for Linux) and it happens no matter the shell (I tried Fish and Bash).

I've tried to:

  • reconfigure the keyboard via dpkg-reconfigure keyboard-configuration where I was switching between 101/102/104/105-key keyboards
  • setxkbmap -layout us which resulted in Cannot open display "default display" msg

EDIT (adding extra info):

  • Windows 10, version 20H2 (Build 19042.1348).
  • Within WSL2 I use Ubuntu 20.04 LTS.
  • I use the default terminal (not sure how to switch terminals in WSL).
  • Font used is a Nerd Font (Sauce Code Pro NF), but changing the font back to the default ones doesn't make a difference.
  • Current CodePage 65001 UTF-8
  • 2
    You don't mention what terminal you are using or the version of Windows, so I'm going to assume that you are using Windows 10 with the default (legacy) Windows Console Host. If you are using a different terminal, please let us know via edit to the question. Also, I realize by the fact that you say the shell isn't interpreting this that it probably isn't a font issue, but what is the font in use? Thanks! Nov 23, 2021 at 20:02
  • Also, assuming Windows Console Host, what does the Code Page show in the Properties (under the first tab labeled "Options"? Nov 23, 2021 at 21:50

1 Answer 1


This was not a problem of WSL itself, but more general Windows/keyboard one. Even in other apps if I type |, I get ¦ instead.

I was using the EN/US keyboard, however the Windows I was given was configured for UK/IRL (Ireland). Once the Windows Keyboard layout was reconfigured to EN/US, the issue was fixed.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.