" [40;5R" auto appare on new line when i press "Enter" key #12932

Closed
opened 2026-01-31 03:29:20 +00:00 by claunia · 3 comments
Owner

Originally created by @iqianxing on GitHub (Mar 9, 2021).

Environment

Windows build number: MSYS_NT-10.0-18363 3.1.7-340.x86_64
Windows Terminal version (if applicable):1.6.10571.0

Steps to reproduce

  1. use ssh connect to remote linux in cmd environment;
  2. docker exec -it containerName /sh/bin
  3. press enter key, "[40;5R" auto appare on new line
    image

or like bellow:
image

Originally created by @iqianxing on GitHub (Mar 9, 2021). # Environment Windows build number: MSYS_NT-10.0-18363 3.1.7-340.x86_64 Windows Terminal version (if applicable):1.6.10571.0 # Steps to reproduce 1. use ssh connect to remote linux in cmd environment; 2. ```docker exec -it containerName /sh/bin``` 3. press enter key, "[40;5R" auto appare on new line ![image](https://user-images.githubusercontent.com/2938263/110426442-113adf80-80e1-11eb-8fc7-525ae3e881c8.png) or like bellow: ![image](https://user-images.githubusercontent.com/2938263/110426524-39c2d980-80e1-11eb-9dbb-20a5f2a2c010.png)
Author
Owner

@zadjii-msft commented on GitHub (Mar 9, 2021):

Weird. Something's asking for the cursor position, but then not reading the response - it's just echoing it to the input of sh.

Which ssh are you using? ssh.exe that ships with Windows? ssh from a WSL distro? Or some other ssh? And which version of ssh?

Does this repro if you run /bin/bash in the docker container? Or just with sh?

@zadjii-msft commented on GitHub (Mar 9, 2021): Weird. Something's asking for the cursor position, but then not reading the response - it's just echoing it to the input of `sh`. Which `ssh` are you using? `ssh.exe` that ships with Windows? `ssh` from a WSL distro? Or some other `ssh`? And which version of `ssh`? Does this repro if you run `/bin/bash` in the docker container? Or just with `sh`?
Author
Owner

@jdebp commented on GitHub (Mar 12, 2021):

People have been hitting these problems from long before Windows Terminal came along, and they are always a matter of a prompt string or a pre/post-input hook of some sort emitting a terminal control sequence that causes the terminal to send back a response, without then reading the response.

I'd say talk to your Linux system's administrator about shell prompts on that machine, except that apparently you are the system administrator. ☺ Check out what is in your prompt shell variables, and your PROMPT_COMMAND shell variable. On many distributions there's often all sorts of stuff, from hooks into git to XTerm title manipulation. This is not a Windows Terminal problem. It is just obeying the output that your remote Linux system has sent.

@jdebp commented on GitHub (Mar 12, 2021): People have been hitting these problems from long before Windows Terminal came along, and they are always a matter of a prompt string or a pre/post-input hook of some sort emitting a terminal control sequence that causes the terminal to send back a response, without then reading the response. I'd say talk to your Linux system's administrator about shell prompts on that machine, except that apparently you _are_ the system administrator. ☺ Check out what is in your prompt shell variables, and your `PROMPT_COMMAND` shell variable. On many distributions there's often all sorts of stuff, from hooks into `git` to XTerm title manipulation. This is not a Windows Terminal problem. It is just obeying the output that your remote Linux system has sent.
Author
Owner

@zadjii-msft commented on GitHub (Mar 12, 2021):

Yea, this sure does sound external to me.

@zadjii-msft commented on GitHub (Mar 12, 2021): Yea, this sure does sound external to me.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#12932