Strange terminal behavior with special characters over SSH from WSL to Ubuntu server #198

Open
opened 2026-01-30 21:45:20 +00:00 by claunia · 0 comments
Owner

Originally created by @saidaspen on GitHub (Mar 20, 2018).

Originally assigned to: @zadjii-msft on GitHub.

Short description

Whenever I connect to a Ubuntu server from my Windows machine, inside of of Ubuntu installed in Windows Subsystem for Linux the terminal is acting very strangely.

Whenever I try to edit a line which contains dash (-) or plus (+) and possibly also other similar special characters then the terminal seems to be unable to insert any text prior to that character.

Let me show you. In this case I go back in command history using up-arrow, but that is not needed. Same thing happens if I just go back to start of line, either with CTRL-A or by means of arrow keys.

This happens when I go WSL (Ubuntu 16.04) -> SSH -> (Ubuntu 16.04) (tried against two different remote Ubuntu hosts).
It does not happen if I go from for example Git Bash in Windows over SSH to the same server. Nor does it happen if I go from a computer with Mac OS over SSH to the same server.

Example

iq8fx

Build and setup

  • Windows build number: Microsoft Windows [Version 10.0.16299.309]
  • Local Linux (in WSL): Ubuntu 16.04.4 LTS
  • Remove Linux: Ubuntu 16.04.4 LTS

PS and Locale

Local machine

$echo "$PS1"
\[\033]0;:/home/said\007\]\n\[\033[32m\]\u@\h \[\033[35m\] \[\033[33m\]\w\[\033[36m\]\[\033[0m\]\n$

$locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

Remote machine

: echo "$PS1"
\[\033[38;5;2m\]\h\[\]\[\033[38;5;29m\] \[\]\[\033[38;5;11m\]\w\[\]\[\033[38;5;15m\]\n: \[\]

: locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
Originally created by @saidaspen on GitHub (Mar 20, 2018). Originally assigned to: @zadjii-msft on GitHub. # Short description Whenever I connect to a Ubuntu server from my Windows machine, inside of of Ubuntu installed in Windows Subsystem for Linux the terminal is acting very strangely. Whenever I try to edit a line which contains dash (-) or plus (+) and possibly also other similar special characters then the terminal seems to be unable to insert any text prior to that character. Let me show you. In this case I go back in command history using up-arrow, but that is not needed. Same thing happens if I just go back to start of line, either with CTRL-A or by means of arrow keys. This happens when I go WSL (Ubuntu 16.04) -> SSH -> (Ubuntu 16.04) (tried against two different remote Ubuntu hosts). It does not happen if I go from for example Git Bash in Windows over SSH to the same server. Nor does it happen if I go from a computer with Mac OS over SSH to the same server. # Example ![iq8fx](https://user-images.githubusercontent.com/7727687/37644993-d589ce3c-2c25-11e8-96e6-0fc8c5f4720a.gif) # Build and setup * Windows build number: Microsoft Windows [Version 10.0.16299.309] * Local Linux (in WSL): Ubuntu 16.04.4 LTS * Remove Linux: Ubuntu 16.04.4 LTS ## PS and Locale ### Local machine ```bash $echo "$PS1" \[\033]0;:/home/said\007\]\n\[\033[32m\]\u@\h \[\033[35m\] \[\033[33m\]\w\[\033[36m\]\[\033[0m\]\n$ $locale LANG=en_US.UTF-8 LANGUAGE= LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_IDENTIFICATION="en_US.UTF-8" LC_ALL= ``` ### Remote machine ```bash : echo "$PS1" \[\033[38;5;2m\]\h\[\]\[\033[38;5;29m\] \[\]\[\033[38;5;11m\]\w\[\]\[\033[38;5;15m\]\n: \[\] : locale LANG=en_US.UTF-8 LANGUAGE= LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_IDENTIFICATION="en_US.UTF-8" LC_ALL= ```
claunia added the Product-ConhostIssue-Question labels 2026-01-30 21:45:20 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#198