Unexpexted behavior with whitespace characters in interactive mode #23540

Open
opened 2026-01-31 08:45:18 +00:00 by claunia · 2 comments
Owner

Originally created by @a-528 on GitHub (Aug 24, 2025).

Windows Terminal version

1.22.12111.0

Windows build number

10.0.19045.6216

Other Software

Command Prompt
Powershell
Bash

Steps to reproduce

This bug was discovered while using Kopia and age (encryption tool).

Kopia example:
I tried connecting to a repository with kopia repository connect filesystem --path /path/to/repo, but got an error after entering my password. The error presents in interactive mode.

Using Command Prompt, Powershell and bash with WSL2 through Windows Terminal all failed when entering my password. If I used Command Prompt, Powershell or bash standalone, no error happened and I could connect.

age example:
A file encrypted with age through Windows Terminal, no matter the shell, can only be decrypted with Windows Terminal. Using the standalone shells gives incorrect password error.

Likewise encrypting a file through a standalone shell, will result in error if Windows Terminal is used to attempt decryption.

The problem:
My testing has shown that Windows Terminal isn't correctly handling the passwords in interactive mode if they have trailing whitespace characters. Example of such password entered in interactive mode is "passwd123 ".

I imagine there's quite a few other cases where this different behavior could impact end users.

Expected Behavior

As a normal end user I except Windows Terminal to pass my complete input.

Actual Behavior

Widows Terminal removes trailing whitespace characters from input (demonstrated in interactive mode). I do not know if this bug could impact usage outside of interactive move.

Originally created by @a-528 on GitHub (Aug 24, 2025). ### Windows Terminal version 1.22.12111.0 ### Windows build number 10.0.19045.6216 ### Other Software Command Prompt Powershell Bash ### Steps to reproduce This bug was discovered while using Kopia and age (encryption tool). **Kopia example:** I tried connecting to a repository with `kopia repository connect filesystem --path /path/to/repo`, but got an error after entering my password. The error presents in interactive mode. Using Command Prompt, Powershell and bash with WSL2 through Windows Terminal all failed when entering my password. If I used Command Prompt, Powershell or bash standalone, no error happened and I could connect. **age example:** A file encrypted with age through Windows Terminal, no matter the shell, can only be decrypted with Windows Terminal. Using the standalone shells gives incorrect password error. Likewise encrypting a file through a standalone shell, will result in error if Windows Terminal is used to attempt decryption. **The problem:** My testing has shown that Windows Terminal isn't correctly handling the passwords in interactive mode if they have trailing whitespace characters. Example of such password entered in interactive mode is "passwd123 ". I imagine there's quite a few other cases where this different behavior could impact end users. ### Expected Behavior As a normal end user I except Windows Terminal to pass my complete input. ### Actual Behavior Widows Terminal removes trailing whitespace characters from input (demonstrated in interactive mode). I do not know if this bug could impact usage outside of interactive move.
claunia added the Needs-TriageIssue-BugNeeds-Attention labels 2026-01-31 08:45:18 +00:00
Author
Owner

@lhecker commented on GitHub (Aug 25, 2025):

Check out this setting:

Image
@lhecker commented on GitHub (Aug 25, 2025): Check out this setting: <img width="2050" height="1044" alt="Image" src="https://github.com/user-attachments/assets/2ab40f22-d561-4fb3-9dd0-be85b6cea2ee" />
Author
Owner

@a-528 commented on GitHub (Aug 26, 2025):

That would be it. I didn't even think it could be an option. In my opinion it's a bad default as it goes against what most other shells do, just my two cents.

Than you for the quick response.

@a-528 commented on GitHub (Aug 26, 2025): That would be it. I didn't even think it could be an option. In my opinion it's a bad default as it goes against what most other shells do, just my two cents. Than you for the quick response.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#23540