Skip to content

[Bug]: winapp ui send-keys --via send-input silently drops characters when sending long text #657

Description

@chiaramooney

Describe the bug

When sending long text via winapp ui send-keys "text=<long string>" --via send-input, a significant number of characters are silently dropped. Sending a 1000-character string resulted in only 434 characters arriving in the target control. The command reports ✅ Sent 1 key action(s) via send-input with exit code 0, giving no indication that characters were lost.

This likely occurs because SendInput injects individual keystroke events and the target application cannot process them all at the rate they're injected.

To Reproduce

Prereqs: Open Notepad, note its PID.

# Focus Notepad and clear editor
winapp ui focus "Text editor" -a <PID>
winapp ui send-keys "ctrl+a" --via send-input -a <PID>
winapp ui send-keys "delete" --via send-input -a <PID>

# Send 1000 characters
$long = "X" * 1000
winapp ui send-keys "text=$long" --via send-input -a <PID>
# Output: ✅ Sent 1 key action(s) via send-input

# Wait a few seconds for processing, then verify
Start-Sleep -Seconds 3
winapp ui get-value "Text editor" -a <PID> --json
# Result: text field contains only ~434 'X' characters instead of 1000

Expected behavior

Either:

  1. All 1000 characters should arrive in the target control (e.g., by chunking/throttling the input injection), or
  2. The command should warn when text length exceeds a known-reliable threshold (e.g., "Warning: long text may lose characters via send-input — consider using winapp ui set-value for bulk text"), or
  3. The command should verify delivery and report if characters were dropped.

Screenshots

N/A

OS Version and details

Windows 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions