Closed alexey-vostrikov closed 3 years ago
Hi Alexey!
You are right. Turbo Vision uses the Win32 Console API, and the MINGW console has traditionally not supported it.
However, since Git for Windows 2.27.0, the Git Bash console has had support for Windows-native pseudo consoles. So I suggest you to check if you already have the latest version of Git Bash or if you need to enable this feature manually.
If that still doesn't work, all I could do would be to pop up a native console automatically. So you would be able to use Turbo Vision applications, but not directly from a MINGW console.
Make sure to enable this option during setup:
This is what I get:
Unfortunately, mouse does not seem to be supported :(.
Can tvision detect winpty console and support it? To make applications written using t vision work on any consoles.
Can tvision detect winpty console and support it?
How can I do it?
I am not a developer, but i think you could read something like https://stackoverflow.com/questions/48199794/winpty-and-git-bash
https://github.com/msys2/MINGW-packages/pull/2675 python3: Use is_cygpty() to detect a terminal
Okay, thanks for investigating.
Turbo Vision prints the error you show in the image when the system calls needed to interact with the console fail. What the commit you shared seems to do is add a clause to an if
statement so that Python doesn't refuse to interact with the terminal. So in the case of Turbo Vision, it would be useless to add a check like is_cygpty
if the system calls for console interaction will fail anyway.
In theory, or at least as I understand it, winpty is exactly what is needed: a compatibility bridge between terminals using VT sequences and applications using the Win32 console API. Thus, I would expect Turbo Vision to work out of the box. But in practice, it doesn't work. I can't even get winpty cmd
to work on Git Bash. So I guess I'll have to ask the winpty developers.
If none if this works, the only solution will be to implement terminal I/O with VT sequences. The most reasonable way would be to support Ncurses on Windows, since the code handling Ncurses interaction is already there. I can't promise I will implement this anytime soon. If you or anyone else wants to give it a try, I encourage you to contribute to the project.
Cheers.
Thanks for your attention, i just looking for console text editor for using with git-bash in windows. So it seemed to me that tvedit or turbo are the best candidates.
Okay. Thanks for your interest :)
I tried spawning a native console instead of printing that error message and exiting, but it didn't work, I don't understand why.
So I tried the latest Git Bash on ConEmu and the application started just fine. However, there is an issue with input. I found a related ConEmu bug report and commented there: https://github.com/Maximus5/ConEmu/issues/2065#issuecomment-719993061.
After having talked with the author of ConEmu, I suggest you to create a Task that just invokes the bash shell directly, so that the native console host is used instead of mintty:
With this Turbo Vision should work out of the box:
but if i change dir to bin it works
Segmentation fault
I think this happens when startup doesn't fail but still is unable to get the console dimensions. This could have been fixed by a previous commit. Can you upgrade to the latest commit and recompile?
but if i change dir to bin it works
Do you mean this?
cd bin
./tvedit.exe
That's strange. Do all the demo applications crash?
This now sort of works with a workaround. When ran in Git Bash without pseudoconsole support, the application will spawn a separate terminal and run in it. This may not be what you were expecting, but it works.
TVedit does not work from git-bash MINGW console