SendInput with newlines in it outputs the text backward #20319

Open
opened 2026-01-31 07:10:06 +00:00 by claunia · 0 comments
Owner

Originally created by @PankajBhojwani on GitHub (Aug 1, 2023).

Originally assigned to: @PankajBhojwani on GitHub.

Windows Terminal version

latest build of main

Windows build number

No response

Other Software

Powershell 7

Steps to reproduce

Make a 'sendInput' command with newlines in the settings json, example:

            "command": 
            {
                "action": "sendInput",
                "input": "a\nb\nc"
            },
            "name": "test sendinput"

Invoke the command in terminal

Expected Behavior

The text output should be a, then b, then c as below

image

Actual Behavior

The actual output is reversed, and goes c->b->a

image
Originally created by @PankajBhojwani on GitHub (Aug 1, 2023). Originally assigned to: @PankajBhojwani on GitHub. ### Windows Terminal version latest build of main ### Windows build number _No response_ ### Other Software Powershell 7 ### Steps to reproduce Make a 'sendInput' command with newlines in the settings json, example: ``` "command": { "action": "sendInput", "input": "a\nb\nc" }, "name": "test sendinput" ``` Invoke the command in terminal ### Expected Behavior The text output should be a, then b, then c as below <img width="357" alt="image" src="https://github.com/microsoft/terminal/assets/26824113/85f62b7c-5749-4671-8bac-eb37318bce4a"> ### Actual Behavior The actual output is reversed, and goes c->b->a <img width="353" alt="image" src="https://github.com/microsoft/terminal/assets/26824113/d428823a-a653-479e-ab2e-2a3b9849dc5e">
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#20319