microsoft / microsoft/terminal

Unexpexted behavior with whitespace characters in interactive mode

Open
#19,267 2 comments 0 reactions 0 assignees View on GitHub
Issue-Bug Needs-Attention Needs-Triage
Dominant language
C++
Stars
105k
Forks
9.6k
Avg merge
3d 17h
Merged PRs (30d)
29

Description

### 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.

Contributor guide

Open the contributing guide

Research direction

The report provides no repository file, test, or entry point. Start by reproducing the issue in Windows Terminal with an interactive password ending in whitespace, comparing it with standalone Command Prompt, PowerShell, and Bash. Done means interactive input preserves trailing whitespace consistently and the reproduction cases pass without breaking other input handling.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, cpp, powershell
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.