Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve support for native console programs #56

Closed
GoogleCodeExporter opened this issue Jun 4, 2015 · 105 comments
Closed

Improve support for native console programs #56

GoogleCodeExporter opened this issue Jun 4, 2015 · 105 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Start the Win32 Python (not the Cygwin port) inside mintty

What is the expected output? What do you see instead?
The interactive Python prompt should be displayed. Instead, nothing happens
and the shell remains suspended until I press Ctrl-C.

What version of the product are you using? On what operating system?
0.3.5-1

Please provide any additional information below.
Win32 Python is works fine under Console2
(http://sourceforge.net/projects/console/), which is a different Windows
terminal emulator.

Original issue reported on code.google.com by sami.kyo...@gmail.com on 17 Feb 2009 at 3:07

ethanwhite added a commit to ethanwhite/windows-installer that referenced this issue Aug 22, 2015
Git for Windows recently switched to using MinTTY as the default emulator.
There is a long running issue with running external programs in MinTTY[1]
and one solution is to run programs through winpty. This commit creates
aliases that run the program on it's own when possible and fall back to
using winpty when necessary.

[1] mintty/mintty#56
ethanwhite added a commit to ethanwhite/windows-installer that referenced this issue Aug 22, 2015
Git for Windows recently switched to using MinTTY as the default emulator.
There is a long running issue with running external programs in MinTTY[1]
and one solution is to run programs through winpty. This commit creates
aliases that run the program on its own when possible and fall back to
using winpty when necessary.

[1] mintty/mintty#56
@eximius313
Copy link

Is there any hope for solving this issue?

@mintty
Copy link
Owner

mintty commented Oct 18, 2019

Yes, you can expect it to be solved with the next cygwin release which supports the new Windows ConPTY API.

@Biswa96
Copy link
Contributor

Biswa96 commented Oct 18, 2019

@eximius313 You can also download and use the cygwin test builds now by selecting test radio button in cygwin setup. But as they are test builds random crashes may occur.

@eximius313
Copy link

I'm using it via GitBash, so it's not that easy ;)

@mintty
Copy link
Owner

mintty commented Dec 16, 2019

Cygwin 3.1.0 has been released with ConPTY support.

@codesculpture
Copy link

codesculpture commented Feb 4, 2024

Cygwin 3.1.0 has been released with ConPTY support.

Hey @mintty , i read the whole conversation but still cant figure how to effectively do SetConsoleMode in a git bash, If i fed PipedHandle which is got from GetStdHandle(STD_INP_HANDLE) it would result in InvalidHandle, Also if i get the console handle through CreateFile by CONIN$ and it would not making any changes in ConsoleMode
For ex: I need to disable Echo Mode in git bash, but seems i cant ?

@mintty
Copy link
Owner

mintty commented Feb 5, 2024

That question is out of scope here. Mintty and bash provide POSIX style programming environments. ConPTY support is available (by cygwin) to support interworking, but if you wish to program Windows console style, you need to get advice elsewhere.

@mintty
Copy link
Owner

mintty commented Feb 5, 2024

If you have a program that runs in native Windows console (the cmd thing) and does not work in cygwin, you may ask on the cygwin mailing list.

@codesculpture
Copy link

Thanks @mintty will reach cygwin then

@mintty
Copy link
Owner

mintty commented Feb 5, 2024

One further note, as you mentioned git bash: I don't know whether git bash enables ConPTY support by default meanwhile (as MSYS2 does). If not, you could set environment variable CYGWIN=enable_pcon and then start another terminal from the command line to enforce it.

@mintty
Copy link
Owner

mintty commented Feb 5, 2024

OK, at least my instance of Git Bash does not support ConPTY (workaround see above), so maybe you should give them an issue.

@mintty
Copy link
Owner

mintty commented Feb 5, 2024

As a persistent workaround, configure it in your home .minttyrc file:
echo ConPTY=on >> ~/.minttyrc

@codesculpture
Copy link

@mintty this is actually working, echo ConPTY=on >> ~/.minttyrc. But can i know what is happening here, i dont quite understand where is the actual problem is please?

@mintty
Copy link
Owner

mintty commented Feb 8, 2024

Console support (mentioned above, ConPTY) is provided by cygwin. It's enabled by default in cygwin and meanwhile MSYS2 but apparently not in Git bash. With the given option, mintty configures it to be enabled by cygwin/MSYS2.

@mintty
Copy link
Owner

mintty commented Feb 24, 2024

You can also configure ConPTY support by adding MSYS=enable_pcon to file /etc/git-bash.config as described in the mintty wiki.
You can also enable ConPTY support during installation of Git for Windows, late in the "question and answer" game, by clicking the checkbox
Enable experimental support for pseudo consoles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants