No output in git bash profile while there is output in pure git bash #20535

Closed
opened 2026-01-31 07:16:48 +00:00 by claunia · 5 comments
Owner

Originally created by @Kasparsu on GitHub (Sep 23, 2023).

Windows Terminal version

1.17.11461.0

Windows build number

10.0.22621.0

Other Software

https://github.com/domeengine/dome
git bash https://gitforwindows.org/

Steps to reproduce

  • download dome
  • execute it trough git bash profile in windows terminal
  • no output

Expected Behavior

running dome in command line should output log it does so when run with pure git bash

Actual Behavior

Program outputs nothing in windows terminal but does in pure git bash

Originally created by @Kasparsu on GitHub (Sep 23, 2023). ### Windows Terminal version 1.17.11461.0 ### Windows build number 10.0.22621.0 ### Other Software https://github.com/domeengine/dome git bash https://gitforwindows.org/ ### Steps to reproduce - download dome - execute it trough git bash profile in windows terminal - no output ### Expected Behavior running dome in command line should output log it does so when run with pure git bash ### Actual Behavior Program outputs nothing in windows terminal but does in pure git bash
claunia added the Needs-TriageIssue-BugNeeds-Attention labels 2026-01-31 07:16:48 +00:00
Author
Owner

@Kasparsu commented on GitHub (Sep 24, 2023):

learned that -mconsole flag was not set and that kinda fixed it but now if application is run without terminal it it opens a console window

@Kasparsu commented on GitHub (Sep 24, 2023): learned that -mconsole flag was not set and that kinda fixed it but now if application is run without terminal it it opens a console window
Author
Owner

@Kasparsu commented on GitHub (Sep 24, 2023):

found a workaround, but still kinda weird that git bash without win terminal handles stuff differently then with.
https://github.com/domeengine/dome/pull/267

@Kasparsu commented on GitHub (Sep 24, 2023): found a workaround, but still kinda weird that git bash without win terminal handles stuff differently then with. https://github.com/domeengine/dome/pull/267
Author
Owner

@DHowett commented on GitHub (Sep 27, 2023):

Thanks for filing!

There's a few different variables here that I'm interested in. I haven't heard of -mconsole, so that might be one of these already.

Git Bash uses its own terminal emulator (mintty) by default.

Would you be able to test this in the original Windows Console?
You can get to it by explicitly running conhost, and then running git bash from inside the Command Prompt it launches.

If the Dome issue reproduces there, it's either a Dome or MSYS issue. If it doesn't, that's probably absolutely something under our control.

@DHowett commented on GitHub (Sep 27, 2023): Thanks for filing! There's a few different variables here that I'm interested in. I haven't heard of `-mconsole`, so that might be one of these already. Git Bash uses its own terminal emulator (mintty) by default. Would you be able to test this in the _original Windows Console_? You can get to it by explicitly running `conhost`, and then running git bash from inside the Command Prompt it launches. If the Dome issue reproduces there, it's either a Dome or MSYS issue. If it doesn't, that's probably absolutely something under our control.
Author
Owner

@Kasparsu commented on GitHub (Sep 28, 2023):

Yeah the issue was happening both in pure cmd as well as powershell so I guess that answers the question. We fixed it on the dome side by checking if console is attached and then attaching the console if not

 if(!GetStdHandle(STD_OUTPUT_HANDLE)) {
    if (AttachConsole(ATTACH_PARENT_PROCESS)) { 
      freopen("CONOUT$","wb",stdout);
      freopen("CONOUT$","wb",stderr);
    }
}
@Kasparsu commented on GitHub (Sep 28, 2023): Yeah the issue was happening both in pure cmd as well as powershell so I guess that answers the question. We fixed it on the dome side by checking if console is attached and then attaching the console if not ``` c if(!GetStdHandle(STD_OUTPUT_HANDLE)) { if (AttachConsole(ATTACH_PARENT_PROCESS)) { freopen("CONOUT$","wb",stdout); freopen("CONOUT$","wb",stderr); } } ```
Author
Owner

@DHowett commented on GitHub (Sep 29, 2023):

Thanks so much for following up!

@DHowett commented on GitHub (Sep 29, 2023): Thanks so much for following up!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#20535