[GH-ISSUE #2698] Piping to stdin does not work in windows #63650

Closed
opened 2026-05-03 14:34:47 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @jmorganca on GitHub (Feb 23, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/2698

Originally assigned to: @dhiltgen on GitHub.

Minor issue, but piping to stdin doesn't work on windows with git bash

$ cat README.md  | ollama run gemma "What is in this document?"
failed to get console mode for stdin: The handle is invalid.
Originally created by @jmorganca on GitHub (Feb 23, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/2698 Originally assigned to: @dhiltgen on GitHub. Minor issue, but piping to stdin doesn't work on windows with git bash ``` $ cat README.md | ollama run gemma "What is in this document?" failed to get console mode for stdin: The handle is invalid. ```
GiteaMirror added the bugwindows labels 2026-05-03 14:34:47 -05:00
Author
Owner

@mattjoyce commented on GitHub (Feb 25, 2024):

Well, it sort of works, but the stdin handle error persists

C:\Users\Matt>echo "whats the capital of australia" | ollama run gemma:2b
failed to get console mode for stdin: The handle is invalid.
The capital of Australia is Canberra. It is a city in the Australian Capital Territory, which is the federal
capital of Australia. Canberra is also the largest city in Australia by land area.

<!-- gh-comment-id:1962765590 --> @mattjoyce commented on GitHub (Feb 25, 2024): Well, it sort of works, but the stdin handle error persists _C:\Users\Matt>echo "whats the capital of australia" | ollama run gemma:2b failed to get console mode for stdin: The handle is invalid. The capital of Australia is Canberra. It is a city in the Australian Capital Territory, which is the federal capital of Australia. Canberra is also the largest city in Australia by land area._
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#63650